Skip to content

Commit

Permalink
fix: cst naming conflicts with built-in Object prototype props
Browse files Browse the repository at this point in the history
fixes #1724
  • Loading branch information
bd82 committed Jan 3, 2022
1 parent 9b472d4 commit 93c78cd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/chevrotain/benchmark_web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ With the **Next** version (locally built version on current branch).

- JS Engines, hotspots optimizations can slightly improve the results on concurrent runs.

8. Inspect the `Relative Speed` column in `index_next.html`, e.g
8. Inspect the `Relative Speed` column in `index_next.html`, e.g:
- If it is 105%, there is likely a small performance improvement.
- If it is 80% there is a large performance regression.

Expand Down
1 change: 1 addition & 0 deletions packages/chevrotain/benchmark_web/parsers/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const options = {
}
},
current: {
// bundle: "../chevrotain.js",
bundle: "https://unpkg.com/chevrotain/lib/chevrotain.js",
parserConfig: {
maxLookahead: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ export class RecognizerEngine {
this.RULE_OCCURRENCE_STACK.push(idxInCallingRule)
this.RULE_STACK.push(shortName)
// NOOP when cst is disabled
this.cstInvocationStateUpdate(fullName, shortName)
this.cstInvocationStateUpdate(fullName)
}

isBackTracking(this: MixedInParser): boolean {
Expand Down
8 changes: 2 additions & 6 deletions packages/chevrotain/src/parse/parser/traits/tree_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,10 @@ export class TreeBuilder {
}
}

cstInvocationStateUpdate(
this: MixedInParser,
fullRuleName: string,
shortName: string | number
): void {
cstInvocationStateUpdate(this: MixedInParser, fullRuleName: string): void {
const cstNode: CstNode = {
name: fullRuleName,
children: {}
children: Object.create(null)
}

this.setInitialNodeLocation(cstNode)
Expand Down
6 changes: 6 additions & 0 deletions packages/website/docs/changes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## X.Y.Z (INSERT_DATE_HERE)

#### Bug Fixes

- [CST naming conflicts with built-in Object prototype props](https://github.com/Chevrotain/chevrotain/issues/1724)

## 9.1.0 (10-9-2021)

#### Minor Changes
Expand Down

0 comments on commit 93c78cd

Please sign in to comment.