aboutsummaryrefslogtreecommitdiff
path: root/lib/parse.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-12-25 00:55:39 +0000
committerGitHub <noreply@github.com>2019-12-25 00:55:39 +0000
commitab050e7a9415b3d60d02a360becaa25b4a9ab2f1 (patch)
tree269a49aad5669795be2a46167b9289aa101fee91 /lib/parse.js
parent75aa6ef8483e6ccde0999cd6d21e695d84703ac0 (diff)
downloadtracifyjs-ab050e7a9415b3d60d02a360becaa25b4a9ab2f1.tar.gz
tracifyjs-ab050e7a9415b3d60d02a360becaa25b4a9ab2f1.zip
fix corner case in `directives` (#3645)
Diffstat (limited to 'lib/parse.js')
-rw-r--r--lib/parse.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/parse.js b/lib/parse.js
index c9ee01fd..740ef5f2 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -790,9 +790,10 @@ function parse($TEXT, options) {
var dir = S.in_directives;
var body = expression(true);
if (dir) {
- var token = body.start;
- if (body instanceof AST_String && token.raw.indexOf("\\") == -1) {
- S.input.add_directive(token.value);
+ if (body instanceof AST_String) {
+ var value = body.start.raw.slice(1, -1);
+ S.input.add_directive(value);
+ body.value = value;
} else {
S.in_directives = dir = false;
}