Skip to content

Commit

Permalink
Merge branch 'release/4.2.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk Lüth authored and Dirk Lüth committed Feb 6, 2018
2 parents 262049d + 268f6a8 commit 914fecd
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 22 deletions.
2 changes: 1 addition & 1 deletion dist/cache/dispose.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/demand.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/demand.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/handler/css.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/html.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/json.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/legacy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/text.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/cookie.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/lzstring.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/sri.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "qoopido.demand",
"title": "Qoopido.demand",
"description": "Promise like module loader using XHR requests and localStorage caching to dynamically load JavaScript and CSS + dynamic dependency resolution + support for custom handlers",
"version": "4.2.6",
"version": "4.2.7",
"homepage": "https://github.com/dlueth/qoopido.demand",
"author": {
"name": "Dirk Lueth",
Expand Down
29 changes: 20 additions & 9 deletions src/inheritance.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
/* global
global, document, demand, provide, queue, processor, settings, setTimeout, clearTimeout, storage,
TRUE,
objectCreate, objectDefineProperty, objectGetOwnPropertyNames, objectGetOwnPropertyDescriptor,
ClassDescriptor
*/

//=require constants.js
//=require shortcuts.js
//=require class/descriptor.js

(function() {
(function(strPrototype) {
var descriptor;

function extend(parent) {
function functionExtends(source) {
var self = this,
prototype = self.prototype,
properties = {},
prototype = self[strPrototype],
names = objectGetOwnPropertyNames(prototype),
properties = { constructor: new ClassDescriptor(self, TRUE, TRUE)},
i = 0, property;

for(; (property = names[i]); i++) {
for(; (property = names[i]) && !properties[property]; i++) {
properties[property] = objectGetOwnPropertyDescriptor(prototype, property);
}

properties.constructor = new ClassDescriptor(self);
self.prototype = objectCreate(parent.prototype || parent, properties);
try {
self[strPrototype] = objectCreate(source[strPrototype] || source, properties);
} catch(e) {
// ES6 class prototypes are readonly at least in Chrome
// (and assignment throws an error in strict mode) ...
}

// ... which is handled here
if(self[strPrototype] === prototype) {
throw new TypeError('Unable to extend, prototype is not writable');
}

return self;
}

descriptor = new ClassDescriptor(extend);
descriptor = new ClassDescriptor(functionExtends);

objectDefineProperty(Function.prototype, 'extends', descriptor);
objectDefineProperty(global.Function.prototype, 'extends', descriptor);
}());
}('prototype'));

0 comments on commit 914fecd

Please sign in to comment.