Comparing version 0.3.1 to 0.4.0
@@ -0,0 +0,0 @@ # moddle Descriptor |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -48,9 +48,10 @@ 'use strict'; | ||
var property = this.model.getPropertyDescriptor(target, name), | ||
propertyName = property.name; | ||
var property = this.model.getPropertyDescriptor(target, name); | ||
if (!property) { | ||
return target[name]; | ||
return target.$attrs[name]; | ||
} | ||
var propertyName = property.name; | ||
// check if access to collection property and lazily initialize it | ||
@@ -57,0 +58,0 @@ if (!target[propertyName] && property.isMany) { |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
{ | ||
"name": "moddle", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "A library for importing meta-model based file formats into JS", | ||
@@ -5,0 +5,0 @@ "directories": { |
@@ -0,0 +0,0 @@ # moddle |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -432,2 +432,17 @@ 'use strict'; | ||
it('should return $attrs property on non-metamodel defined property access', function() { | ||
// given | ||
var BaseWithNumericId = model.getType('props:BaseWithNumericId'); | ||
// when | ||
var instance = new BaseWithNumericId({ 'id': 1000 }); | ||
instance.$attrs.unknown = 'UNKNOWN'; | ||
// then | ||
expect(instance.get('unknown')).toEqual('UNKNOWN'); | ||
}); | ||
it('access via original name', function() { | ||
@@ -434,0 +449,0 @@ |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1313
48280