Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Commit

Permalink
Merge pull request #198 from yavorsky/typed-ie
Browse files Browse the repository at this point in the history
Change built-in-targets according to Typed Array methods
  • Loading branch information
existentialism authored Mar 14, 2017
2 parents ed59056 + 491dc2c commit 81a7a82
Show file tree
Hide file tree
Showing 10 changed files with 260 additions and 91 deletions.
65 changes: 56 additions & 9 deletions data/built-in-features.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,69 @@
// https://github.com/zloirock/core-js

const typedArrayMethods = [
"typed arrays / %TypedArray%.from",
"typed arrays / %TypedArray%.of",
"typed arrays / %TypedArray%.prototype.subarray",
"typed arrays / %TypedArray%.prototype.join",
"typed arrays / %TypedArray%.prototype.indexOf",
"typed arrays / %TypedArray%.prototype.lastIndexOf",
"typed arrays / %TypedArray%.prototype.slice",
"typed arrays / %TypedArray%.prototype.every",
"typed arrays / %TypedArray%.prototype.filter",
"typed arrays / %TypedArray%.prototype.forEach",
"typed arrays / %TypedArray%.prototype.map",
"typed arrays / %TypedArray%.prototype.reduce",
"typed arrays / %TypedArray%.prototype.reduceRight",
"typed arrays / %TypedArray%.prototype.reverse",
"typed arrays / %TypedArray%.prototype.some",
"typed arrays / %TypedArray%.prototype.sort",
"typed arrays / %TypedArray%.prototype.copyWithin",
"typed arrays / %TypedArray%.prototype.find",
"typed arrays / %TypedArray%.prototype.findIndex",
"typed arrays / %TypedArray%.prototype.fill",
"typed arrays / %TypedArray%.prototype.keys",
"typed arrays / %TypedArray%.prototype.values",
"typed arrays / %TypedArray%.prototype.entries",
"typed arrays / %TypedArray%.prototype[Symbol.iterator]",
"typed arrays / %TypedArray%[Symbol.species]"
];

const es2015 = {
// "es6.typed/array-buffer": "typed arrays / ",
"es6.typed.data-view": "typed arrays / DataView",
"es6.typed.int8-array": "typed arrays / Int8Array",
"es6.typed.uint8-array": "typed arrays / Uint8Array",
"es6.typed.uint8-clamped-array": "typed arrays / Uint8ClampedArray",
"es6.typed.int16-array": "typed arrays / Int16Array",
"es6.typed.uint16-array": "typed arrays / Uint16Array",
"es6.typed.int32-array": "typed arrays / Int32Array",
"es6.typed.uint32-array": "typed arrays / Uint32Array",
"es6.typed.float32-array": "typed arrays / Float32Array",
"es6.typed.float64-array": "typed arrays / Float64Array",
"es6.typed.int8-array": {
features: ["typed arrays / Int8Array"].concat(typedArrayMethods)
},
"es6.typed.uint8-array": {
features: ["typed arrays / Uint8Array"].concat(typedArrayMethods)
},
"es6.typed.uint8-clamped-array": {
features: ["typed arrays / Uint8ClampedArray"].concat(typedArrayMethods)
},
"es6.typed.int16-array": {
features: ["typed arrays / Int16Array"].concat(typedArrayMethods)
},
"es6.typed.uint16-array": {
features: ["typed arrays / Uint16Array"].concat(typedArrayMethods)
},
"es6.typed.int32-array": {
features: ["typed arrays / Int32Array"].concat(typedArrayMethods)
},
"es6.typed.uint32-array": {
features: ["typed arrays / Uint32Array"].concat(typedArrayMethods)
},
"es6.typed.float32-array": {
features: ["typed arrays / Float32Array"].concat(typedArrayMethods)
},
"es6.typed.float64-array": {
features: ["typed arrays / Float64Array"].concat(typedArrayMethods)
},

"es6.map": "Map",
"es6.set": "Set",
"es6.weak-map": "WeakMap",
"es6.weak-set": "WeakSet",

// Proxy not implementable

"es6.reflect.apply": "Reflect / Reflect.apply",
Expand Down
143 changes: 63 additions & 80 deletions data/built-ins.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,102 +11,85 @@
"ios": 6
},
"es6.typed.int8-array": {
"chrome": 5,
"opera": 12,
"edge": 12,
"firefox": 4,
"safari": 5,
"node": 0.12,
"ie": 10,
"android": 4,
"ios": 6
"chrome": 51,
"edge": 13,
"firefox": 48,
"safari": 10,
"node": 6.5,
"ios": 10,
"opera": 38
},
"es6.typed.uint8-array": {
"chrome": 5,
"opera": 12,
"edge": 12,
"firefox": 4,
"safari": 5,
"node": 0.12,
"ie": 10,
"android": 4,
"ios": 6
"chrome": 51,
"edge": 13,
"firefox": 48,
"safari": 10,
"node": 6.5,
"ios": 10,
"opera": 38
},
"es6.typed.uint8-clamped-array": {
"chrome": 5,
"opera": 12,
"edge": 12,
"firefox": 4,
"safari": 6,
"node": 0.12,
"android": 4.4,
"ios": 7
"chrome": 51,
"edge": 13,
"firefox": 48,
"safari": 10,
"node": 6.5,
"ios": 10,
"opera": 38
},
"es6.typed.int16-array": {
"chrome": 5,
"opera": 12,
"edge": 12,
"firefox": 4,
"safari": 5,
"node": 0.12,
"ie": 10,
"android": 4,
"ios": 6
"chrome": 51,
"edge": 13,
"firefox": 48,
"safari": 10,
"node": 6.5,
"ios": 10,
"opera": 38
},
"es6.typed.uint16-array": {
"chrome": 5,
"opera": 12,
"edge": 12,
"firefox": 4,
"safari": 5,
"node": 0.12,
"ie": 10,
"android": 4,
"ios": 6
"chrome": 51,
"edge": 13,
"firefox": 48,
"safari": 10,
"node": 6.5,
"ios": 10,
"opera": 38
},
"es6.typed.int32-array": {
"chrome": 5,
"opera": 12,
"edge": 12,
"firefox": 4,
"safari": 5,
"node": 0.12,
"ie": 10,
"android": 4,
"ios": 6
"chrome": 51,
"edge": 13,
"firefox": 48,
"safari": 10,
"node": 6.5,
"ios": 10,
"opera": 38
},
"es6.typed.uint32-array": {
"chrome": 5,
"opera": 12,
"edge": 12,
"firefox": 4,
"safari": 5,
"node": 0.12,
"ie": 10,
"android": 4,
"ios": 6
"chrome": 51,
"edge": 13,
"firefox": 48,
"safari": 10,
"node": 6.5,
"ios": 10,
"opera": 38
},
"es6.typed.float32-array": {
"chrome": 5,
"opera": 12,
"edge": 12,
"firefox": 4,
"safari": 5,
"node": 0.12,
"ie": 10,
"android": 4,
"ios": 6
"chrome": 51,
"edge": 13,
"firefox": 48,
"safari": 10,
"node": 6.5,
"ios": 10,
"opera": 38
},
"es6.typed.float64-array": {
"chrome": 5,
"opera": 12,
"edge": 12,
"firefox": 4,
"safari": 5,
"node": 0.12,
"ie": 10,
"android": 4.1,
"ios": 6
"chrome": 51,
"edge": 13,
"firefox": 48,
"safari": 10,
"node": 6.5,
"ios": 10,
"opera": 38
},
"es6.map": {
"chrome": 51,
Expand Down
10 changes: 9 additions & 1 deletion test/debug-fixtures/builtins/stdout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ Using plugins:
syntax-trailing-function-commas {"chrome":54,"ie":10,"node":6}

Using polyfills:
es6.typed.uint8-clamped-array {"ie":10}
es6.typed.int8-array {"ie":10,"node":6}
es6.typed.uint8-array {"ie":10,"node":6}
es6.typed.uint8-clamped-array {"ie":10,"node":6}
es6.typed.int16-array {"ie":10,"node":6}
es6.typed.uint16-array {"ie":10,"node":6}
es6.typed.int32-array {"ie":10,"node":6}
es6.typed.uint32-array {"ie":10,"node":6}
es6.typed.float32-array {"ie":10,"node":6}
es6.typed.float64-array {"ie":10,"node":6}
es6.map {"ie":10,"node":6}
es6.set {"ie":10,"node":6}
es6.weak-map {"ie":10,"node":6}
Expand Down
10 changes: 9 additions & 1 deletion test/debug-fixtures/specific-targets/stdout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ Using plugins:
syntax-trailing-function-commas {"chrome":54,"edge":13,"firefox":49,"ie":10,"ios":9,"safari":7}

Using polyfills:
es6.typed.uint8-clamped-array {"ie":10}
es6.typed.int8-array {"ie":10,"ios":9,"safari":7}
es6.typed.uint8-array {"ie":10,"ios":9,"safari":7}
es6.typed.uint8-clamped-array {"ie":10,"ios":9,"safari":7}
es6.typed.int16-array {"ie":10,"ios":9,"safari":7}
es6.typed.uint16-array {"ie":10,"ios":9,"safari":7}
es6.typed.int32-array {"ie":10,"ios":9,"safari":7}
es6.typed.uint32-array {"ie":10,"ios":9,"safari":7}
es6.typed.float32-array {"ie":10,"ios":9,"safari":7}
es6.typed.float64-array {"ie":10,"ios":9,"safari":7}
es6.map {"edge":13,"firefox":49,"ie":10,"ios":9,"safari":7}
es6.set {"edge":13,"firefox":49,"ie":10,"ios":9,"safari":7}
es6.weak-map {"edge":13,"firefox":49,"ie":10,"safari":7}
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/preset-options/ie-11-built-ins/actual.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "babel-polyfill";
84 changes: 84 additions & 0 deletions test/fixtures/preset-options/ie-11-built-ins/expected.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import "core-js/modules/es6.typed.int8-array";
import "core-js/modules/es6.typed.uint8-array";
import "core-js/modules/es6.typed.uint8-clamped-array";
import "core-js/modules/es6.typed.int16-array";
import "core-js/modules/es6.typed.uint16-array";
import "core-js/modules/es6.typed.int32-array";
import "core-js/modules/es6.typed.uint32-array";
import "core-js/modules/es6.typed.float32-array";
import "core-js/modules/es6.typed.float64-array";
import "core-js/modules/es6.map";
import "core-js/modules/es6.set";
import "core-js/modules/es6.weak-map";
import "core-js/modules/es6.weak-set";
import "core-js/modules/es6.reflect.apply";
import "core-js/modules/es6.reflect.construct";
import "core-js/modules/es6.reflect.define-property";
import "core-js/modules/es6.reflect.delete-property";
import "core-js/modules/es6.reflect.get";
import "core-js/modules/es6.reflect.get-own-property-descriptor";
import "core-js/modules/es6.reflect.get-prototype-of";
import "core-js/modules/es6.reflect.has";
import "core-js/modules/es6.reflect.is-extensible";
import "core-js/modules/es6.reflect.own-keys";
import "core-js/modules/es6.reflect.prevent-extensions";
import "core-js/modules/es6.reflect.set";
import "core-js/modules/es6.reflect.set-prototype-of";
import "core-js/modules/es6.promise";
import "core-js/modules/es6.symbol";
import "core-js/modules/es6.object.assign";
import "core-js/modules/es6.object.is";
import "core-js/modules/es6.function.name";
import "core-js/modules/es6.string.raw";
import "core-js/modules/es6.string.from-code-point";
import "core-js/modules/es6.string.code-point-at";
import "core-js/modules/es6.string.repeat";
import "core-js/modules/es6.string.starts-with";
import "core-js/modules/es6.string.ends-with";
import "core-js/modules/es6.string.includes";
import "core-js/modules/es6.regexp.flags";
import "core-js/modules/es6.regexp.match";
import "core-js/modules/es6.regexp.replace";
import "core-js/modules/es6.regexp.split";
import "core-js/modules/es6.regexp.search";
import "core-js/modules/es6.array.from";
import "core-js/modules/es6.array.of";
import "core-js/modules/es6.array.copy-within";
import "core-js/modules/es6.array.find";
import "core-js/modules/es6.array.find-index";
import "core-js/modules/es6.array.fill";
import "core-js/modules/es6.array.iterator";
import "core-js/modules/es6.number.is-finite";
import "core-js/modules/es6.number.is-integer";
import "core-js/modules/es6.number.is-safe-integer";
import "core-js/modules/es6.number.is-nan";
import "core-js/modules/es6.number.epsilon";
import "core-js/modules/es6.number.min-safe-integer";
import "core-js/modules/es6.number.max-safe-integer";
import "core-js/modules/es6.math.acosh";
import "core-js/modules/es6.math.asinh";
import "core-js/modules/es6.math.atanh";
import "core-js/modules/es6.math.cbrt";
import "core-js/modules/es6.math.clz32";
import "core-js/modules/es6.math.cosh";
import "core-js/modules/es6.math.expm1";
import "core-js/modules/es6.math.fround";
import "core-js/modules/es6.math.hypot";
import "core-js/modules/es6.math.imul";
import "core-js/modules/es6.math.log1p";
import "core-js/modules/es6.math.log10";
import "core-js/modules/es6.math.log2";
import "core-js/modules/es6.math.sign";
import "core-js/modules/es6.math.sinh";
import "core-js/modules/es6.math.tanh";
import "core-js/modules/es6.math.trunc";
import "core-js/modules/es7.array.includes";
import "core-js/modules/es7.object.values";
import "core-js/modules/es7.object.entries";
import "core-js/modules/es7.object.get-own-property-descriptors";
import "core-js/modules/es7.string.pad-start";
import "core-js/modules/es7.string.pad-end";
import "core-js/modules/web.timers";
import "core-js/modules/web.immediate";
import "core-js/modules/web.dom.iterable";
import "regenerator-runtime/runtime";
12 changes: 12 additions & 0 deletions test/fixtures/preset-options/ie-11-built-ins/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
["../../../../lib", {
"targets": {
"ie": 11
},
"modules": false,
"useBuiltIns": true,
"modules": false
}]
]
}
8 changes: 8 additions & 0 deletions test/fixtures/preset-options/ios-6/expected.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import "core-js/modules/es6.typed.int8-array";
import "core-js/modules/es6.typed.uint8-array";
import "core-js/modules/es6.typed.uint8-clamped-array";
import "core-js/modules/es6.typed.int16-array";
import "core-js/modules/es6.typed.uint16-array";
import "core-js/modules/es6.typed.int32-array";
import "core-js/modules/es6.typed.uint32-array";
import "core-js/modules/es6.typed.float32-array";
import "core-js/modules/es6.typed.float64-array";
import "core-js/modules/es6.map";
import "core-js/modules/es6.set";
import "core-js/modules/es6.weak-map";
Expand Down
Loading

0 comments on commit 81a7a82

Please sign in to comment.