File tree Expand file tree Collapse file tree 3 files changed +3
-14
lines changed Expand file tree Collapse file tree 3 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,6 @@ module.exports = {
17
17
18
18
silent : false ,
19
19
20
- /**
21
- * Whether allow observer to alter data objects'
22
- * __proto__.
23
- *
24
- * @type {Boolean }
25
- */
26
-
27
- proto : true ,
28
-
29
20
/**
30
21
* Whether to use async rendering.
31
22
*/
Original file line number Diff line number Diff line change 1
1
var _ = require ( '../util' )
2
- var config = require ( '../config' )
3
2
var Dep = require ( './dep' )
4
3
var arrayMethods = require ( './array' )
5
4
var arrayKeys = Object . getOwnPropertyNames ( arrayMethods )
@@ -19,7 +18,7 @@ function Observer (value) {
19
18
this . dep = new Dep ( )
20
19
_ . define ( value , '__ob__' , this )
21
20
if ( _ . isArray ( value ) ) {
22
- var augment = config . proto && _ . hasProto
21
+ var augment = _ . hasProto
23
22
? protoAugment
24
23
: copyAugment
25
24
augment ( value , arrayMethods , arrayKeys )
Original file line number Diff line number Diff line change 1
1
var Observer = require ( '../../../../src/observer' )
2
2
var Dep = require ( '../../../../src/observer/dep' )
3
- var config = require ( '../../../../src/config' )
4
3
var _ = require ( '../../../../src/util' )
5
4
6
5
describe ( 'Observer' , function ( ) {
@@ -165,7 +164,7 @@ describe('Observer', function () {
165
164
} )
166
165
167
166
it ( 'no proto' , function ( ) {
168
- config . proto = false
167
+ _ . hasProto = false
169
168
var arr = [ 1 , 2 , 3 ]
170
169
var ob2 = Observer . create ( arr )
171
170
expect ( arr . $set ) . toBeTruthy ( )
@@ -175,7 +174,7 @@ describe('Observer', function () {
175
174
spyOn ( dep2 , 'notify' )
176
175
arr . push ( 1 )
177
176
expect ( dep2 . notify ) . toHaveBeenCalled ( )
178
- config . proto = true
177
+ _ . hasProto = true
179
178
} )
180
179
181
180
} )
You can’t perform that action at this time.
0 commit comments