@webqit/subscript
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -11,3 +11,3 @@ { | ||
"homepage": "https://webqit.io/tooling/subscript", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"license": "MIT", | ||
@@ -14,0 +14,0 @@ "repository": { |
@@ -91,8 +91,10 @@ | ||
} | ||
} else if ((params.references && stmt instanceof AssignmentInterface) && (stmt.val instanceof ReferenceInterface)) { | ||
} else if (params.references && (stmt instanceof AssignmentInterface) && (stmt.val instanceof ReferenceInterface)) { | ||
// E.g: app = document.state; (This statement won't evaluate above if reference was "document.state.something") | ||
params.references = params.references.slice(0); | ||
let basePath = referencesToPaths([stmt.reference])[0], | ||
leafPath = referencesToPaths([stmt.val])[0]; | ||
params.references.forEach(ref => { | ||
let basePath = referencesToPaths([stmt.reference])[0], // app | ||
leafPath = referencesToPaths([stmt.val])[0]; // document.state | ||
params.references.forEach(ref/** document.state.something */ => { | ||
if (pathStartsWith(ref, leafPath)) { | ||
// app.something | ||
params.references.push(basePath.concat(pathAfter(ref, leafPath))); | ||
@@ -99,0 +101,0 @@ } |
@@ -29,3 +29,4 @@ | ||
this.onFalse = onFalse; | ||
this.params = params; | ||
this.params = params; | ||
this.supers = new Map(); | ||
} | ||
@@ -38,6 +39,9 @@ | ||
var errorLevel = context instanceof Scope ? context.params.errorLevel : undefined; | ||
var _context = new Scope({ | ||
main:{}, | ||
super:context, | ||
}, {type: 2, errorLevel}); | ||
if (!this.supers.has(context)) { | ||
this.supers.set(context, new Scope({ | ||
main:{}, | ||
super:context, | ||
}, {type: 2, errorLevel})); | ||
} | ||
var _context = this.supers.get(context); | ||
return this.assertion.eval(context/** original context */, params) | ||
@@ -44,0 +48,0 @@ ? (this.onTrue ? this.onTrue.eval(_context, params) : undefined) |
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
275499
3312