@salesforce/acorn-visualforce
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -134,2 +134,3 @@ module.exports = | ||
tt.vfelExpressionEnd = new TokenType('vfelExpressionEnd'); | ||
tt.metastring = new TokenType('metastring', { startsExpr: true }); // a string with additional metadata to be attached to it | ||
@@ -206,2 +207,4 @@ tt.vfelExpressionStart.updateContext = function vfelExprStartUpdateContext() { | ||
var vfelParser = { | ||
// vfelExpressionsInString: [], | ||
vfel_readToken() { | ||
@@ -509,2 +512,4 @@ // Rewriting original readToken, since vfel tokens are a subset of JS tokens | ||
if (this.type === tt.metastring) return this.parseLiteral(this.value); | ||
return inner.call(this, refDestructuringErrors); | ||
@@ -596,3 +601,4 @@ }; | ||
this.pos += 1; // consuming closing quote | ||
return this.finishToken(tt.string, out); | ||
if (Array.isArray(this.vfelExpressionsInString) && this.vfelExpressionsInString.length > 0) return this.finishToken(tt.metastring, out);else return this.finishToken(tt.string, out); | ||
}; | ||
@@ -603,8 +609,16 @@ }); | ||
return function vfelExtendedParseLiteral(value) { | ||
var node = inner.call(this, value); | ||
if (Array.isArray(this.vfelExpressionsInString) && this.vfelExpressionsInString.length) { | ||
node.vfelExpressions = [].concat(_toConsumableArray(this.vfelExpressionsInString)); | ||
this.vfelExpressionsInString = []; | ||
if (this.type === tt.metastring) { | ||
var node = this.startNode(); | ||
node.value = value; | ||
node.raw = this.input.slice(this.start, this.end); | ||
if (Array.isArray(this.vfelExpressionsInString) && this.vfelExpressionsInString.length) { | ||
node.vfelExpressions = [].concat(_toConsumableArray(this.vfelExpressionsInString)); | ||
this.vfelExpressionsInString = []; | ||
} | ||
this.next(); | ||
return this.finishNode(node, 'MetaString'); | ||
} | ||
return node; | ||
return inner.call(this, value); | ||
}; | ||
@@ -625,2 +639,7 @@ }); | ||
}; | ||
}), instance.extend('jsx_parseAttributeValue', function (inner) { | ||
return function vfelExtendedJSXParseAttributeValue() { | ||
if (this.type === tt.metastring) return this.parseLiteral(this.value); | ||
return inner.call(this); | ||
}; | ||
}); | ||
@@ -627,0 +646,0 @@ } |
{ | ||
"name": "@salesforce/acorn-visualforce", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "acorn extension for Salesforce js dialect with merge fields", | ||
@@ -39,2 +39,3 @@ "main": "dist/index.js", | ||
"eslint-config-recommended": "^1.5.0", | ||
"eslint-loader": "^1.7.1", | ||
"eslint-plugin-babel": "^4.1.0", | ||
@@ -41,0 +42,0 @@ "eslint-plugin-import": "^2.2.0", |
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
156117
12
7
663