goldstein 5.22.0 → 5.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog +5 -0
- package/README.md +0 -5
- package/bin/gs.js +0 -0
- package/package.json +1 -1
- package/packages/keyword-broken-string/index.js +16 -9
package/ChangeLog
CHANGED
package/README.md
CHANGED
package/bin/gs.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ export default function keywordBrokenString(Parser) {
|
|
|
12
12
|
|
|
13
13
|
return super.getTokenFromCode(code);
|
|
14
14
|
}
|
|
15
|
+
|
|
15
16
|
parseVarStatement(node, kind, allowMissingInitializer) {
|
|
16
17
|
this.next();
|
|
17
18
|
this.parseVar(node, false, kind, allowMissingInitializer);
|
|
@@ -20,6 +21,18 @@ export default function keywordBrokenString(Parser) {
|
|
|
20
21
|
return this.finishNode(node, 'VariableDeclaration');
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
goldsteinWrongQuoteStart(ch) {
|
|
25
|
+
if (!ch)
|
|
26
|
+
return true;
|
|
27
|
+
|
|
28
|
+
return ch === QUOTE || ch === MOBILE_CLOSE_QUOTE;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
goldsteinWrongQuoteEnd() {
|
|
32
|
+
if (this.input[this.pos - 1] === ';')
|
|
33
|
+
--this.pos;
|
|
34
|
+
}
|
|
35
|
+
|
|
23
36
|
readString(quote) {
|
|
24
37
|
let out = '';
|
|
25
38
|
let chunkStart = ++this.pos;
|
|
@@ -27,18 +40,13 @@ export default function keywordBrokenString(Parser) {
|
|
|
27
40
|
for (;;) {
|
|
28
41
|
const ch = this.input.charCodeAt(this.pos);
|
|
29
42
|
|
|
30
|
-
if (
|
|
31
|
-
break;
|
|
32
|
-
|
|
33
|
-
if (ch === QUOTE || ch === MOBILE_CLOSE_QUOTE)
|
|
43
|
+
if (this.goldsteinWrongQuoteStart(ch))
|
|
34
44
|
break;
|
|
35
45
|
|
|
36
46
|
/* c8 ignore start */
|
|
37
47
|
if (ch === quote)
|
|
38
48
|
break;
|
|
39
|
-
/* c8 ignore end */
|
|
40
49
|
|
|
41
|
-
/* c8 ignore start */
|
|
42
50
|
if (ch === 92) {
|
|
43
51
|
// '\'
|
|
44
52
|
out += this.input.slice(chunkStart, this.pos);
|
|
@@ -57,9 +65,7 @@ export default function keywordBrokenString(Parser) {
|
|
|
57
65
|
/* c8 ignore end */
|
|
58
66
|
} else {
|
|
59
67
|
if (isNewLine(ch)) {
|
|
60
|
-
|
|
61
|
-
--this.pos;
|
|
62
|
-
|
|
68
|
+
this.goldsteinWrongQuoteEnd();
|
|
63
69
|
break;
|
|
64
70
|
}
|
|
65
71
|
|
|
@@ -80,3 +86,4 @@ function isNewLine(code) {
|
|
|
80
86
|
|| code === 0x2028
|
|
81
87
|
|| code === 0x2029;
|
|
82
88
|
}
|
|
89
|
+
|