@jymfony/autoloader
Advanced tools
Comparing version 0.1.0-alpha.11 to 0.1.0-alpha.12
{ | ||
"name": "@jymfony/autoloader", | ||
"version": "0.1.0-alpha.11", | ||
"version": "0.1.0-alpha.12", | ||
"description": "Jymfony Autoloader", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "node ./tests.js" | ||
}, | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@jymfony/util": "0.1.0-alpha.11" | ||
"@jymfony/util": "0.1.0-alpha.12" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
@@ -102,2 +102,3 @@ const Finder = require('./Finder'); | ||
this._registered = true; | ||
const autoloader = this; | ||
@@ -113,2 +114,6 @@ /** | ||
const retVal = this.__construct(...$args); | ||
if (undefined !== global.mixins && undefined !== this[global.mixins.initializerSymbol]) { | ||
this[global.mixins.initializerSymbol](); | ||
} | ||
if (undefined !== retVal && this !== retVal) { | ||
@@ -118,45 +123,60 @@ return retVal; | ||
let self = this; | ||
if (!! autoloader.debug) { | ||
Reflect.preventExtensions(this); | ||
self = new Proxy(self, { | ||
get: (target, p) => { | ||
if (p !== Symbol.toStringTag && ! Reflect.has(target, p)) { | ||
throw new TypeError('Undefined property ' + p.toString()); | ||
} | ||
return Reflect.get(target, p); | ||
}, | ||
}); | ||
} | ||
if (undefined !== this.__invoke) { | ||
return new Proxy(this.__invoke, { | ||
return new Proxy(self.__invoke, { | ||
get: (target, key) => { | ||
return Reflect.get(this, key); | ||
return Reflect.get(self, key); | ||
}, | ||
set: (target, key, value) => { | ||
return Reflect.set(this, key, value); | ||
return Reflect.set(self, key, value); | ||
}, | ||
has: (target, key) => { | ||
return Reflect.has(this, key); | ||
return Reflect.has(self, key); | ||
}, | ||
deleteProperty: (target, key) => { | ||
return Reflect.deleteProperty(this, key); | ||
return Reflect.deleteProperty(self, key); | ||
}, | ||
defineProperty: (target, key, descriptor) => { | ||
return Reflect.defineProperty(this, key, descriptor); | ||
return Reflect.defineProperty(self, key, descriptor); | ||
}, | ||
enumerate: () => { | ||
return Reflect.enumerate(this); | ||
return Reflect.enumerate(self); | ||
}, | ||
ownKeys: () => { | ||
return Reflect.ownKeys(this); | ||
return Reflect.ownKeys(self); | ||
}, | ||
apply: (target, ctx, args) => { | ||
return this.__invoke(...args); | ||
return self.__invoke(...args); | ||
}, | ||
construct: (target, argumentsList, newTarget) => { | ||
return Reflect.construct(this, argumentsList, newTarget); | ||
return Reflect.construct(self, argumentsList, newTarget); | ||
}, | ||
getPrototypeOf: () => { | ||
return Reflect.getPrototypeOf(this); | ||
return Reflect.getPrototypeOf(self); | ||
}, | ||
setPrototypeOf: (target, proto) => { | ||
return Reflect.setPrototypeOf(this, proto); | ||
return Reflect.setPrototypeOf(self, proto); | ||
}, | ||
isExtensible: () => { | ||
return Reflect.isExtensible(this); | ||
return Reflect.isExtensible(self); | ||
}, | ||
preventExtensions: () => { | ||
return Reflect.preventExtensions(this); | ||
return Reflect.preventExtensions(self); | ||
}, | ||
getOwnPropertyDescriptor: (target, key) => { | ||
return Reflect.getOwnPropertyDescriptor(this, key); | ||
return Reflect.getOwnPropertyDescriptor(self, key); | ||
}, | ||
@@ -163,0 +183,0 @@ }); |
@@ -78,3 +78,3 @@ const Patcher = require('./Parser/Patcher'); | ||
children: [], | ||
exports: undefined, | ||
exports: {}, | ||
filename: fn, | ||
@@ -88,3 +88,3 @@ id: fn, | ||
code = `(function(exports, require, module, __filename, __dirname, __self) { ${code} });`; | ||
code = `(function(exports, require, module, __filename, __dirname, __self) { 'use strict'; ${code} });`; | ||
@@ -91,0 +91,0 @@ const opts = isNyc ? fn : { |
@@ -89,7 +89,8 @@ const Lexer = require('./Lexer'); | ||
const currentPosition = code.length; | ||
const extension = ' extends __jymfony.JObject '; | ||
patchRemoval = () => { | ||
code = code.slice(0, currentPosition - 1) + code.slice(currentPosition + ' extends __jymfony.JObject '.length - 1); | ||
code = code.slice(0, currentPosition - 1) + code.slice(currentPosition + extension.length - 1); | ||
}; | ||
code += ' extends __jymfony.JObject '; | ||
code += extension; | ||
} | ||
@@ -187,6 +188,2 @@ | ||
if (lexer.isNextToken(Lexer.T_CLASS)) { | ||
code += this._processClass(lexer, docblock); | ||
} | ||
if (0 === level) { | ||
@@ -198,2 +195,6 @@ const docblock = JSON.stringify(classDocblock); | ||
code += token.value; | ||
if (lexer.isNextToken(Lexer.T_CLASS)) { | ||
code += this._processClass(lexer, docblock); | ||
} | ||
} | ||
@@ -200,0 +201,0 @@ |
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
101626
26
2858
+ Added@jymfony/exceptions@0.1.0-alpha.12(transitive)
+ Added@jymfony/util@0.1.0-alpha.12(transitive)
- Removed@jymfony/exceptions@0.1.0-alpha.11(transitive)
- Removed@jymfony/util@0.1.0-alpha.11(transitive)
Updated@jymfony/util@0.1.0-alpha.12