@@ -7,13 +7,12 @@ import { isObservable, isSupportObservable } from './externals'
7
7
import { createObservable } from './internals'
8
8
9
9
const wellKnownSymbols = new Set (
10
- Object . getOwnPropertyNames ( Symbol )
11
- . reduce ( ( buf : Symbol [ ] , key ) => {
12
- if ( key === 'arguments' || key === 'caller' ) return buf
13
- const value = Symbol [ key ]
14
- if ( typeof value === 'symbol' ) return buf . concat ( value )
15
- return buf
16
- } , [ ] )
10
+ Object . getOwnPropertyNames ( Symbol ) . reduce ( ( buf : Symbol [ ] , key ) => {
11
+ if ( key === 'arguments' || key === 'caller' ) return buf
12
+ const value = Symbol [ key ]
13
+ if ( typeof value === 'symbol' ) return buf . concat ( value )
14
+ return buf
15
+ } , [ ] )
17
16
)
18
17
19
18
const hasOwnProperty = Object . prototype . hasOwnProperty
@@ -201,6 +200,11 @@ export const baseHandlers: ProxyHandler<any> = {
201
200
return keys
202
201
} ,
203
202
set ( target , key , value , receiver ) {
203
+ // vue2中有对数组原型重写,因此需去除此处proxy
204
+ if ( key === '__proto__' ) {
205
+ target [ key ] = value
206
+ return true
207
+ }
204
208
const hadKey = hasOwnProperty . call ( target , key )
205
209
const newValue = createObservable ( target , key , value )
206
210
const oldValue = target [ key ]
0 commit comments