mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 15:40:02 -04:00
add window.$sImport
This commit is contained in:
parent
c4f31be3ae
commit
b3a3f80376
2 changed files with 9 additions and 0 deletions
5
src/client/import.ts
Normal file
5
src/client/import.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { encodeUrl } from "../shared/rewriters/url"
|
||||
|
||||
window.$sImport = function(url) {
|
||||
return (function() { }.constructor(`return import("${encodeUrl(url)}")`))();
|
||||
}
|
|
@ -42,6 +42,10 @@ function storageProxy(scope: Storage): Storage {
|
|||
case "length":
|
||||
return store.size;
|
||||
default:
|
||||
if (prop in Object.prototype) {
|
||||
return Reflect.get(target, prop);
|
||||
}
|
||||
|
||||
return store.get(prop);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue