can-define
Advanced tools
Comparing version 0.7.20 to 0.7.21
@@ -247,3 +247,3 @@ "use strict"; | ||
}); | ||
sliced.getValueAndBind(); | ||
sliced.start(); | ||
@@ -257,3 +257,3 @@ var joined = new Observation(function(){ | ||
}); | ||
joined.getValueAndBind(); | ||
joined.start(); | ||
@@ -260,0 +260,0 @@ |
@@ -84,3 +84,3 @@ "use strict"; | ||
}); | ||
oi.getValueAndBind(); | ||
oi.start(); | ||
@@ -148,3 +148,3 @@ map.set("foo","bar"); | ||
}); | ||
oi.getValueAndBind(); | ||
oi.start(); | ||
@@ -170,3 +170,3 @@ map.set({a: 1, b: 2}); | ||
}); | ||
oi.getValueAndBind(); | ||
oi.start(); | ||
@@ -238,1 +238,12 @@ map.set("a", 1); | ||
}); | ||
QUnit.test("get will not create properties", function(){ | ||
var method = function(){}; | ||
var MyMap = DefineMap.extend({ | ||
method: method | ||
}); | ||
var m = new MyMap(); | ||
m.get("foo"); | ||
QUnit.equal(m.get("method"), method); | ||
}); |
@@ -139,4 +139,3 @@ var Construct = require("can-construct"); | ||
* | ||
* Get a single property on a DefineMap instance. If the property is not previously defined and | ||
* the object is not [can-define/map/map.seal sealed], it will be dynamically added. | ||
* Get a single property on a DefineMap instance. | ||
* | ||
@@ -156,4 +155,9 @@ * `.get(propName)` only should be used when reading properties that might not have been defined yet, but | ||
if(arguments.length) { | ||
defineHelpers.defineExpando(this, prop); | ||
return this[prop]; | ||
if(prop in this || Object.isSealed(this)) { | ||
return this[prop]; | ||
} else { | ||
Observation.add(this, prop); | ||
return this[prop]; | ||
} | ||
} else { | ||
@@ -160,0 +164,0 @@ return defineHelpers.serialize(this, 'get', {}); |
{ | ||
"name": "can-define", | ||
"version": "0.7.20", | ||
"version": "0.7.21", | ||
"description": "Like can.Map, but without the .attr method.", | ||
@@ -5,0 +5,0 @@ "main": "can-define.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
291422
6673