feat: add polyfills insertion for ES Next used features

This commit is contained in:
Artem Kobzar
2022-02-16 10:49:11 +00:00
committed by Space
parent 76ff717091
commit 804eb61bf0
80 changed files with 8769 additions and 6552 deletions
@@ -1223,9 +1223,9 @@ object ArrayOps : TemplateGroupBase() {
if (primitive == PrimitiveType.Char) {
// Requires comparator because default comparator of 'Array.prototype.sort' compares
// string representation of values
body { "this.asDynamic().sort(::primitiveCompareTo)" }
body { "nativeSort(::primitiveCompareTo)" }
} else {
body { "this.asDynamic().sort()" }
body { "nativeSort()" }
}
}
} else {
@@ -1292,7 +1292,7 @@ object ArrayOps : TemplateGroupBase() {
deprecate(Deprecation("Use other sorting functions from the Standard Library", warningSince = "1.6"))
inlineOnly()
signature("sort(noinline comparison: (a: T, b: T) -> Int)")
body { "asDynamic().sort(comparison)" }
body { "nativeSort(comparison)" }
}
specialFor(ArraysOfObjects) {
deprecate(
@@ -1641,7 +1641,7 @@ object ArrayOps : TemplateGroupBase() {
body {
"""
AbstractList.checkRangeIndexes(fromIndex, toIndex, size)
this.asDynamic().fill(element, fromIndex, toIndex);
nativeFill(element, fromIndex, toIndex);
"""
}
}