Comparing version 0.5.10 to 0.5.11
@@ -79,3 +79,3 @@ /* | ||
if ( ! module_ || typeof module_ !== 'object' ) { | ||
throw new Error( "EXM: this is not an EXM Extension" ) ; | ||
throw new Error( "EXM: this is not an EXM Extension (not an object)" ) ; | ||
} | ||
@@ -92,3 +92,3 @@ | ||
if ( ! module_ || typeof module_ !== 'object' ) { | ||
throw new Error( "EXM: this is not an EXM Extension" ) ; | ||
throw new Error( "EXM: this is not an EXM Extension (not an ES6 module extension and not registered)" ) ; | ||
} | ||
@@ -98,3 +98,3 @@ } | ||
if ( ( module_.__prototypeUID__ !== 'exm/Extension' && module_.__prototypeUID__ !== 'exm/browser/Extension' ) ) { | ||
throw new Error( "EXM: this is not an EXM Extension" ) ; | ||
throw new Error( "EXM: this is not an EXM Extension (no prototype UID found)" ) ; | ||
} | ||
@@ -107,3 +107,3 @@ | ||
try { | ||
await module_.init( this ) ; | ||
await module_.init( this , extModulePath ) ; | ||
console.log( "Extension '" + module_.id + "'" + ( module_.version ? " (v" + module_.version + ") " : '' ) + "is loaded." ) ; | ||
@@ -130,2 +130,3 @@ } | ||
this.host = null ; // the host Exm | ||
this.path = null ; | ||
this.fromModule = options.module ; | ||
@@ -158,6 +159,7 @@ this.hooks = options.hooks || {} ; | ||
Exm.Extension.prototype.init = async function( host ) { | ||
Exm.Extension.prototype.init = async function( host , path_ ) { | ||
if ( this.isInit ) { return ; } | ||
if ( host.ns !== this.ns ) { throw new Error( "EXM Extension's namespace mismatches the Host!" ) ; } | ||
if ( path_ ) { this.path = path_ ; } | ||
this.host = host ; | ||
@@ -164,0 +166,0 @@ |
@@ -50,3 +50,3 @@ /* | ||
this.fromModule = options.module ; | ||
//this.require = this.fromModule.require ; | ||
// For some obscure reasons, this.fromModule.require() does not work well (also module.require !== require) | ||
this.require = Module.createRequire( this.fromModule.filename ) ; | ||
@@ -429,2 +429,3 @@ | ||
this.fromModule = options.module ; | ||
// For some obscure reasons, this.fromModule.require() does not work well (also module.require !== require) | ||
this.require = Module.createRequire( this.fromModule.filename ) ; | ||
@@ -431,0 +432,0 @@ this.hooks = options.hooks || {} ; |
{ | ||
"name": "exm", | ||
"version": "0.5.10", | ||
"version": "0.5.11", | ||
"description": "EXtension Manager.", | ||
@@ -5,0 +5,0 @@ "main": "lib/Exm.js", |
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
32095
698