-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: @putout/plugin-goldstein: c8 v9.1.0
- Loading branch information
1 parent
a728422
commit 1399854
Showing
5 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
function hello() => {} | ||
function world() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function hello() {} | ||
|
||
function world() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import {tokTypes as tt} from 'acorn'; | ||
|
||
export default function fn(Parser) { | ||
return class extends Parser { | ||
parseBlock(createNewLexicalScope, node, exitStrict) { | ||
if (createNewLexicalScope === void 0) | ||
createNewLexicalScope = true; | ||
|
||
if (node === void 0) | ||
node = this.startNode(); | ||
|
||
node.body = []; | ||
// optionally parse arrow | ||
this.eat(tt.arrow); | ||
this.expect(tt.braceL); | ||
|
||
if (createNewLexicalScope) | ||
this.enterScope(0); | ||
|
||
while (this.type !== tt.braceR) { | ||
const stmt = this.parseStatement(null); | ||
node.body.push(stmt); | ||
} | ||
|
||
if (exitStrict) | ||
this.strict = false; | ||
|
||
this.next(); | ||
|
||
if (createNewLexicalScope) | ||
this.exitScope(); | ||
|
||
return this.finishNode(node, 'BlockStatement'); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {createTest} from '../test/index.js'; | ||
import keywordFn from './index.js'; | ||
|
||
const test = createTest(import.meta.url, keywordFn); | ||
|
||
test('goldstein: keyword: arrow', (t) => { | ||
t.compile('arrow'); | ||
t.end(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters