Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "qq", | ||
"description": "A heavy-weight library for promises, based on Q", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"homepage": "http://github.com/kriskowal/qq/", | ||
@@ -6,0 +6,0 @@ "author": "Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)", |
18
qq.js
@@ -315,2 +315,20 @@ (function (require, exports) { | ||
exports.Lazy = function (constructor, promise) { | ||
var prototype = constructor.prototype; | ||
var result = exports.defer(); | ||
result.resolve(promise); | ||
var proxy = Object.create(result.promise); | ||
while (prototype !== Object.prototype) { | ||
Object.getOwnPropertyNames(prototype).forEach(function (name) { | ||
if (typeof prototype[name] === "function") { | ||
proxy[name] = function () { | ||
return Q.post(result.promise, name, arguments); | ||
}; | ||
} | ||
}); | ||
prototype = Object.getPrototypeOf(prototype); | ||
} | ||
return proxy; | ||
}; | ||
// boilerplate that permits this module to be used as a | ||
@@ -317,0 +335,0 @@ // <script> in less-than-ideal situations. |
exports['test deep'] = require('./deep'); | ||
exports['test lazy'] = require('./lazy'); | ||
@@ -4,0 +5,0 @@ if (module == require.main) |
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
20342
8
363