malinajs 0.7.9 → 0.7.11
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/malina.js +19 -39
- package/package.json +1 -1
package/malina.js
CHANGED
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
const extractKeywords = (exp) => {
|
|
142
|
-
let ast = acorn.parse(exp, { sourceType: 'module', ecmaVersion:
|
|
142
|
+
let ast = acorn.parse(exp, { sourceType: 'module', ecmaVersion: 'latest' });
|
|
143
143
|
|
|
144
144
|
const keys = new Set();
|
|
145
145
|
const rec = (n) => {
|
|
@@ -963,48 +963,28 @@
|
|
|
963
963
|
const reader = new Reader(source);
|
|
964
964
|
|
|
965
965
|
const readScript = (reader) => {
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
let a, p, q;
|
|
971
|
-
while(true) {
|
|
972
|
-
p = a;
|
|
973
|
-
a = reader.read();
|
|
974
|
-
if(q) {
|
|
975
|
-
if(a != q) continue;
|
|
976
|
-
if(p == '\\') continue;
|
|
977
|
-
q = null;
|
|
978
|
-
continue;
|
|
966
|
+
class ScriptParser extends acorn.Parser {
|
|
967
|
+
readToken_lt_gt(code) {
|
|
968
|
+
if (this.input.slice(this.pos, this.pos + 9) == '</script>') {
|
|
969
|
+
return this.finishToken(acorn.tokTypes.eof);
|
|
979
970
|
}
|
|
980
|
-
|
|
981
|
-
if(a == '/' && p != '\\') return;
|
|
971
|
+
return super.readToken_lt_gt(code);
|
|
982
972
|
}
|
|
983
|
-
};
|
|
984
973
|
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
}
|
|
990
|
-
if(reader.probe('/')) {
|
|
991
|
-
if(reader.readIf('//')) {
|
|
992
|
-
while(reader.read() != '\n');
|
|
993
|
-
continue;
|
|
974
|
+
scan() {
|
|
975
|
+
this.nextToken();
|
|
976
|
+
while (this.type !== acorn.tokTypes.eof) {
|
|
977
|
+
this.parseStatement(null, true, null);
|
|
994
978
|
}
|
|
995
|
-
|
|
996
|
-
while(true) {
|
|
997
|
-
if(reader.read() == '*' && reader.readIf('/')) break;
|
|
998
|
-
}
|
|
999
|
-
continue;
|
|
1000
|
-
}
|
|
1001
|
-
readRegExp();
|
|
1002
|
-
continue;
|
|
979
|
+
return this.end;
|
|
1003
980
|
}
|
|
1004
|
-
if(reader.readIf('</script>')) {
|
|
1005
|
-
return reader.sub(start, reader.index - 9);
|
|
1006
|
-
} else reader.read();
|
|
1007
981
|
}
|
|
982
|
+
|
|
983
|
+
let start = reader.index;
|
|
984
|
+
let parser = new ScriptParser({ ecmaVersion: 'latest', sourceType: 'module' }, reader.source, start);
|
|
985
|
+
let end = parser.scan();
|
|
986
|
+
reader.index = end + 9;
|
|
987
|
+
return reader.sub(start, end);
|
|
1008
988
|
};
|
|
1009
989
|
|
|
1010
990
|
const readStyle = () => {
|
|
@@ -6872,7 +6852,7 @@
|
|
|
6872
6852
|
});
|
|
6873
6853
|
}
|
|
6874
6854
|
|
|
6875
|
-
const version = '0.7.
|
|
6855
|
+
const version = '0.7.11';
|
|
6876
6856
|
|
|
6877
6857
|
|
|
6878
6858
|
async function compile(source, config = {}) {
|
|
@@ -6891,7 +6871,7 @@
|
|
|
6891
6871
|
css: true,
|
|
6892
6872
|
passClass: true,
|
|
6893
6873
|
immutable: false,
|
|
6894
|
-
deepCheckingProps:
|
|
6874
|
+
deepCheckingProps: true,
|
|
6895
6875
|
useGroupReferencing: true
|
|
6896
6876
|
}, config);
|
|
6897
6877
|
|