generate-js-bindings
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -33,2 +33,46 @@ var EventEmitter = require('generate-js-events'); | ||
Bindable.generateGetters = function generateGetter(bindable, descriptor, properties) { | ||
var getters = {}, | ||
p = properties || descriptor, | ||
d = properties && descriptor; | ||
properties = (p && typeof p === 'object') ? p : {}; | ||
descriptor = (d && typeof d === 'object') ? d : { enumerable: true }; | ||
function makeGetter(property) { | ||
return function getter() { | ||
var _ = this; | ||
return bindable.get(property); | ||
}; | ||
} | ||
for (var i = 0; i < properties.length; i++) { | ||
getters[properties[i]] = { get: makeGetter(properties[i]) }; | ||
} | ||
bindable.definePrototype(descriptor, getters); | ||
}; | ||
Bindable.generateSetters = function generateSetter(bindable, descriptor, properties) { | ||
var setters = {}, | ||
p = properties || descriptor, | ||
d = properties && descriptor; | ||
properties = (p && typeof p === 'object') ? p : {}; | ||
descriptor = (d && typeof d === 'object') ? d : { enumerable: true }; | ||
function makeSetter(property) { | ||
return function setter() { | ||
var _ = this; | ||
return bindable.set(property); | ||
}; | ||
} | ||
for (var i = 0; i < properties.length; i++) { | ||
setters[properties[i]] = { set: makeSetter(properties[i]) }; | ||
} | ||
bindable.definePrototype(descriptor, setters); | ||
}; | ||
Bindable.definePrototype({ | ||
@@ -35,0 +79,0 @@ /** |
{ | ||
"name": "generate-js-bindings", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "A data binding layer for Generate JS.", | ||
@@ -27,4 +27,4 @@ "main": "bindings.js", | ||
"dependencies": { | ||
"generate-js-events": "^2.1.1" | ||
"generate-js-events": "^2.1.2" | ||
} | ||
} |
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
11621
179
Updatedgenerate-js-events@^2.1.2