feat: add polyfills insertion for ES Next used features
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
package kotlin.js
|
||||
|
||||
@JsNativeImplementation("""
|
||||
@JsPolyfill("""
|
||||
(function() {
|
||||
if (typeof globalThis === 'object') return;
|
||||
Object.defineProperty(Object.prototype, '__magic__', {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
@file:JsQualifier("Math")
|
||||
package kotlin.js
|
||||
|
||||
@JsNativeImplementation("""
|
||||
if (typeof Math == "object" && Math !== null & typeof Math.imul === "undefined") {
|
||||
@JsPolyfill("""
|
||||
if (typeof Math.imul === "undefined") {
|
||||
Math.imul = function imul(a, b) {
|
||||
return ((a & 0xffff0000) * (b & 0xffff) + (a & 0xffff) * (b | 0)) | 0;
|
||||
}
|
||||
|
||||
@@ -142,9 +142,7 @@ internal fun isArray(obj: Any): Boolean {
|
||||
return isJsArray(obj) && !(obj.asDynamic().`$type$`)
|
||||
}
|
||||
|
||||
internal fun isArrayish(o: dynamic) =
|
||||
isJsArray(o) || js("ArrayBuffer").isView(o).unsafeCast<Boolean>()
|
||||
|
||||
internal fun isArrayish(o: dynamic) = isJsArray(o) || arrayBufferIsView(o)
|
||||
|
||||
internal fun isChar(@Suppress("UNUSED_PARAMETER") c: Any): Boolean {
|
||||
error("isChar is not implemented")
|
||||
|
||||
Reference in New Issue
Block a user