malinajs 0.7.8 → 0.7.10
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 +27 -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;
|
|
994
|
-
}
|
|
995
|
-
if(reader.readIf('/*')) {
|
|
996
|
-
while(true) {
|
|
997
|
-
if(reader.read() == '*' && reader.readIf('/')) break;
|
|
998
|
-
}
|
|
999
|
-
continue;
|
|
974
|
+
scan() {
|
|
975
|
+
this.nextToken();
|
|
976
|
+
while (this.type !== acorn.tokTypes.eof) {
|
|
977
|
+
this.parseStatement(null, true, null);
|
|
1000
978
|
}
|
|
1001
|
-
|
|
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 = () => {
|
|
@@ -4982,8 +4962,9 @@
|
|
|
4982
4962
|
|
|
4983
4963
|
this.require('$context');
|
|
4984
4964
|
|
|
4965
|
+
let deepChecking = this.config.deepCheckingProps;
|
|
4985
4966
|
let reference = null;
|
|
4986
|
-
let propsFn = [], propsSetter = [], $class = [], staticProps = true
|
|
4967
|
+
let propsFn = [], propsSetter = [], $class = [], staticProps = true;
|
|
4987
4968
|
let slotBlocks = [];
|
|
4988
4969
|
let anchorBlocks = [];
|
|
4989
4970
|
|
|
@@ -5134,6 +5115,12 @@
|
|
|
5134
5115
|
let inner, outer;
|
|
5135
5116
|
if(name[0] == ':') inner = name.substring(1);
|
|
5136
5117
|
else inner = name.substring(5);
|
|
5118
|
+
let mods = inner.split('|');
|
|
5119
|
+
inner = mods.shift();
|
|
5120
|
+
mods.forEach(mod => {
|
|
5121
|
+
if (mod == 'deep') deepChecking = true;
|
|
5122
|
+
else throw new Error('Wrong modifier: ' + mod);
|
|
5123
|
+
});
|
|
5137
5124
|
if(value) outer = unwrapExp(value);
|
|
5138
5125
|
else outer = inner;
|
|
5139
5126
|
assert(isSimpleName(inner), `Wrong property: '${inner}'`);
|
|
@@ -6865,7 +6852,7 @@
|
|
|
6865
6852
|
});
|
|
6866
6853
|
}
|
|
6867
6854
|
|
|
6868
|
-
const version = '0.7.
|
|
6855
|
+
const version = '0.7.10';
|
|
6869
6856
|
|
|
6870
6857
|
|
|
6871
6858
|
async function compile(source, config = {}) {
|
|
@@ -6884,6 +6871,7 @@
|
|
|
6884
6871
|
css: true,
|
|
6885
6872
|
passClass: true,
|
|
6886
6873
|
immutable: false,
|
|
6874
|
+
deepCheckingProps: false,
|
|
6887
6875
|
useGroupReferencing: true
|
|
6888
6876
|
}, config);
|
|
6889
6877
|
|