update acorn and parse expression as module script

pull/5423/head
Tan Li Hau 5 years ago
parent 5f938535a1
commit ef40dea221

6
package-lock.json generated

@ -315,9 +315,9 @@
"dev": true
},
"acorn": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz",
"integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz",
"integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==",
"dev": true
},
"acorn-globals": {

@ -68,7 +68,7 @@
"@types/node": "^8.10.53",
"@typescript-eslint/eslint-plugin": "^3.0.2",
"@typescript-eslint/parser": "^3.0.2",
"acorn": "^7.3.1",
"acorn": "^7.4.0",
"agadoo": "^1.1.0",
"c8": "^5.0.1",
"code-red": "^0.1.3",

@ -3,11 +3,12 @@ import * as code_red from 'code-red';
export const parse = (source: string): Node => code_red.parse(source, {
sourceType: 'module',
ecmaVersion: 11,
ecmaVersion: 12,
locations: true
});
export const parse_expression_at = (source: string, index: number): Node => code_red.parseExpressionAt(source, index, {
ecmaVersion: 11,
sourceType: 'module',
ecmaVersion: 12,
locations: true
});

@ -0,0 +1,53 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
detach,
init,
insert,
noop,
safe_not_equal,
space,
text
} from "svelte/internal";
function create_fragment(ctx) {
let t0;
let t1;
let t2_value = import.meta.url + "";
let t2;
return {
c() {
t0 = text(/*url*/ ctx[0]);
t1 = space();
t2 = text(t2_value);
},
m(target, anchor) {
insert(target, t0, anchor);
insert(target, t1, anchor);
insert(target, t2, anchor);
},
p: noop,
i: noop,
o: noop,
d(detaching) {
if (detaching) detach(t0);
if (detaching) detach(t1);
if (detaching) detach(t2);
}
};
}
function instance($$self) {
const url = import.meta.url;
return [url];
}
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, {});
}
}
export default Component;

@ -0,0 +1,6 @@
<script>
const url = import.meta.url;
</script>
{ url }
{ import.meta.url }

@ -0,0 +1,3 @@
export default {
html: `2048 2048`
};

@ -0,0 +1,5 @@
<script>
const num = 2_048;
</script>
{num} {2_048}
Loading…
Cancel
Save