Skip to content

Commit d3780bc

Browse files
committed
use slice for regexp as well
1 parent acb5114 commit d3780bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

acorn-to-esprima.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ exports.toToken = function (token) {
5757
pattern: token.value.pattern,
5858
flags: token.value.flags
5959
};
60-
token.value = String(token.value.value);
60+
token.value = source.slice(token.range[0], token.range[1]);
6161
}
6262

6363
return token;

0 commit comments

Comments
 (0)