Skip to content

Commit 2e9db42

Browse files
committed
Made the convertAllProperties configuration option false by default
1 parent 7953f5e commit 2e9db42

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = {
3636
* use case and environment, this might introduce non-neglible
3737
* performance penalties.
3838
*/
39-
convertAllProperties: true,
39+
convertAllProperties: false,
4040

4141
/**
4242
* Internal flag to indicate the delimiters have been

test/unit/specs/observer/observer_spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var Observer = require('../../../../src/observer')
22
var Dep = require('../../../../src/observer/dep')
33
var _ = require('../../../../src/util')
4+
var config = require('../../../../src/config')
45

56
describe('Observer', function () {
67

@@ -39,6 +40,9 @@ describe('Observer', function () {
3940
})
4041

4142
it('create on already observed object', function () {
43+
var previousConvertAllProperties = config.convertAllProperties
44+
config.convertAllProperties = true
45+
4246
// on object
4347
var obj = {}
4448
var val = 0
@@ -65,6 +69,8 @@ describe('Observer', function () {
6569
// should call underlying setter
6670
obj.a = 10
6771
expect(val).toBe(10)
72+
73+
config.convertAllProperties = previousConvertAllProperties
6874
})
6975

7076
it('create on array', function () {
@@ -112,6 +118,9 @@ describe('Observer', function () {
112118
})
113119

114120
it('observing object prop change on defined property', function () {
121+
var previousConvertAllProperties = config.convertAllProperties
122+
config.convertAllProperties = true
123+
115124
var obj = { val: 2 }
116125
Object.defineProperty(obj, 'a', {
117126
configurable: true,
@@ -143,6 +152,8 @@ describe('Observer', function () {
143152
expect(obj.val).toBe(3) // make sure 'setter' was called
144153
obj.val = 5
145154
expect(obj.a).toBe(5) // make sure 'getter' was called
155+
156+
config.convertAllProperties = previousConvertAllProperties
146157
})
147158

148159
it('observing set/delete', function () {

0 commit comments

Comments
 (0)