Comments (4)
Not sure, but maybe related to jquery/esprima#1991
from esprima-dotnet.
Also could be related jquery/esprima#2049
from esprima-dotnet.
The first issue you mentioned is already covered by a unit test and was ported.
I created a unit test with the script you pasted and it worked fine. Could you try to create a unit test that fails?
Something like this in Fixtures.cs
for instance:
[Fact]
public void TemplateLiteral()
{
var script = @"
output += `${table(
messages.map(message => {
let messageType;
if (message.fatal || message.severity === 2) {
messageType = chalk.red(""error"");
summaryColor = ""red"";
} else {
messageType = chalk.yellow(""warning"");
}
return [
"""",
message.line || 0,
message.column || 0,
messageType,
message.message.replace(/ ([^ ])\.$/ u, ""$1""),
chalk.dim(message.ruleId || """")
];
}),
{
align:["""", ""r"", ""l""],
stringLength(str) {
return stripAnsi(str).length;
}
}
).split(""\n"").map(el => el.replace(/ (\d +)\s + (\d +) / u, (m, p1, p2) => chalk.dim(`${ p1}:${ p2}`))).join(""\n"")}\n\n`;
";
var parser = new JavaScriptParser(script, new ParserOptions());
var result = parser.ParseScript();
Assert.NotNull(result);
}
from esprima-dotnet.
I can confirm that this is parsed without errors now.
from esprima-dotnet.
Related Issues (20)
- Eliminate JavaScript letter casing inconsistencies HOT 12
- Add a way to parse string into Location
- Optional chaining-related parser issues
- Big drop in possible maximum value of MaxAssignmentDepth HOT 4
- Missing ECMAScript 2020+ features HOT 18
- How to get Body.Range from Node? HOT 2
- Issue with spread/rest operator HOT 3
- Add a note README.md stating that the Ast is immutable HOT 2
- Problem with the latest build on Xamarin/iOS HOT 10
- Do we have accessor keyword for properties? HOT 4
- Wrong handling of private Identifierers HOT 3
- Test262 - New testcase -> write back javascript and compare
- RegEx checking via C# Engine does not work the same as in Javascript HOT 1
- Refactor of Class parsing (and other esprima features) HOT 3
- Invalid for loop when writing to javascript HOT 3
- Undefined group issues in regex parser
- Add using keyword as the proposal is in stage 3 HOT 2
- Version 3.0.0-beta-10 suffix problem HOT 10
- Import Assertions (aka Import Atributes) are back at stage 3 so we should add them again HOT 2
- Inconsistencies with ESTree HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esprima-dotnet.