abstract-object
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -113,2 +113,4 @@ (function() { | ||
AbstractObject.createThis = util.createThisObject; | ||
return AbstractObject; | ||
@@ -115,0 +117,0 @@ |
@@ -176,2 +176,11 @@ /** `Object#toString` result shortcuts */ | ||
}, | ||
createObjectWith: function(aClass, aArguments) { | ||
args = [aClass]; | ||
if (aArguments) | ||
args = args.concat(aArguments); | ||
var result = new (Function.prototype.bind.apply(aClass, args)); | ||
if (aClass !== aClass.prototype.constructor) | ||
aClass.prototype.constructor.apply(result, aArguments); | ||
return result; | ||
}, | ||
createObject: function(aClass) { | ||
@@ -178,0 +187,0 @@ var result = new (Function.prototype.bind.apply(aClass, arguments)); |
{ | ||
"name": "abstract-object", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "AbstractObject with Object State Events Support, RefObject with RefCount and AddRef/Release Support.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/snowyu/abstract-object", |
@@ -15,2 +15,5 @@ # AbtractObject | ||
* `...`: the left arguments will be passed into the class constructor. | ||
* `createWith`(class, arguments): the `createWith` class method uses to create a new object instance(the util.createObject is the same function). | ||
* `class`: the class constructor to create a new instance. | ||
* `arguments` *(array)*: the arguments will be passed into the class constructor. | ||
* `init(...)`: abstract initialization method after a new instance creating. | ||
@@ -17,0 +20,0 @@ * `...`: the constructor's arguments should be passed into init method. |
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
47130
445
196