Skip to content

Commit

Permalink
feat: support block scoping (#3)
Browse files Browse the repository at this point in the history
* fix: support block scoping

* fix: furthur improve block scoping, fix catch clause test
  • Loading branch information
pionxzh authored Jul 21, 2024
1 parent 3a36a39 commit ab0c23a
Show file tree
Hide file tree
Showing 6 changed files with 421 additions and 35 deletions.
4 changes: 4 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json.schemastore.org/mocharc.json",
"require": "tsx"
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"scripts": {
"gen": "ts-node --transpile-only script/gen-types.ts",
"test": "npm run gen && npm run build && script/run-tests.sh",
"run-test": "mocha --reporter spec --full-trace lib/test/run.js",
"test:watch": "mocha --reporter spec --full-trace src/test/run.ts --watch --watch-files src",
"run-test": "npm run gen && npm run build && mocha --reporter spec --full-trace lib/test/run.js",
"clean": "rimraf lib/",
"build": "tsc",
"prepare": "npm run clean && npm run build"
Expand All @@ -63,6 +64,7 @@
"reify": "0.20.12",
"rimraf": "6.0.1",
"ts-node": "10.9.2",
"tsx": "^4.16.2",
"typescript": "5.5.3"
},
"engines": {
Expand Down
270 changes: 270 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/node-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default function nodePathPlugin(fork: Fork): NodePathConstructor {
var scope = pp && pp.scope;

if (n.Node.check(value) &&
Scope.isEstablishedBy(value)) {
Scope.isEstablishedBy(this)) {
scope = new Scope(this, scope);
}

Expand Down
Loading

0 comments on commit ab0c23a

Please sign in to comment.