feat: add openjdk nashorn shim
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
3be1f78a14
commit
23c7cb955a
@ -4,6 +4,7 @@ import i18n from '@ccms/i18n'
|
|||||||
let polyfillStartTime = new Date().getTime()
|
let polyfillStartTime = new Date().getTime()
|
||||||
i18n.initialize()
|
i18n.initialize()
|
||||||
console.i18n("ms.polyfill.initialize")
|
console.i18n("ms.polyfill.initialize")
|
||||||
|
import './openjdk-nashorn-shim'
|
||||||
import './es5-ext'
|
import './es5-ext'
|
||||||
import './node-shim'
|
import './node-shim'
|
||||||
import 'core-js'
|
import 'core-js'
|
||||||
|
7
packages/polyfill/src/openjdk-nashorn-shim.ts
Normal file
7
packages/polyfill/src/openjdk-nashorn-shim.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// fix OpenJDK Nahsorn setPrototypeOf Bug
|
||||||
|
try {
|
||||||
|
Java.type('org.openjdk.nashorn.api.scripting.NashornScriptEngine')
|
||||||
|
Object.setPrototypeOf = ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b })
|
||||||
|
} catch (error) {
|
||||||
|
}
|
||||||
|
export { }
|
Loading…
Reference in New Issue
Block a user