Skip to content

Commit 8b089dc

Browse files
author
枫弦
committed
update escope version for support String Template
1 parent 2598633 commit 8b089dc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/esshorten.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*!
22
Copyright (C) 2013 Yusuke Suzuki <[email protected]>
33
44
Redistribution and use in source and binary forms, with or without
@@ -234,10 +234,10 @@
234234

235235
function mangleLabels(tree) {
236236
var labelScope;
237-
237+
var FuncOrProgram = [Syntax.Program, Syntax.FunctionExpression, Syntax.FunctionDeclaration];
238238
estraverse.traverse(tree, {
239239
enter: function (node) {
240-
if (escope.Scope.isVariableScopeRequired(node)) {
240+
if (FuncOrProgram.indexOf(node.type) >= 0) {
241241
labelScope = new LabelScope(labelScope);
242242
return;
243243
}
@@ -255,7 +255,7 @@
255255
},
256256
leave: function (node) {
257257
labelScope.unregister(node);
258-
if (escope.Scope.isVariableScopeRequired(node)) {
258+
if (FuncOrProgram.indexOf(node.type) >= 0) {
259259
labelScope = labelScope.close();
260260
}
261261
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"url": "http://github.com/estools/esshorten.git"
2222
},
2323
"dependencies": {
24+
"escope": "~3.3.0",
2425
"estraverse": "~4.1.1",
25-
"escope": "~1.0.1",
2626
"esutils": "~2.0.2"
2727
},
2828
"devDependencies": {

0 commit comments

Comments
 (0)