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

Commit

Permalink
Add check for ArrayBuffer[Symbol.species] (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
existentialism authored and hzoo committed Mar 30, 2017
1 parent aead61c commit 046f326
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/built-in-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const typedArrayMethods = [
"typed arrays / %TypedArray%.prototype.values",
"typed arrays / %TypedArray%.prototype.entries",
"typed arrays / %TypedArray%.prototype[Symbol.iterator]",
"typed arrays / %TypedArray%[Symbol.species]"
"typed arrays / %TypedArray%[Symbol.species]",
];

const es2015 = {
// "es6.typed/array-buffer": "typed arrays / ",
"es6.typed.array-buffer": "typed arrays / ArrayBuffer[Symbol.species]",
"es6.typed.data-view": "typed arrays / DataView",
"es6.typed.int8-array": {
features: ["typed arrays / Int8Array"].concat(typedArrayMethods)
Expand Down
10 changes: 10 additions & 0 deletions data/built-ins.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"es6.typed.array-buffer": {
"chrome": 51,
"edge": 13,
"firefox": 48,
"safari": 10,
"node": 6.5,
"ios": 10,
"opera": 38,
"electron": 1.2
},
"es6.typed.data-view": {
"chrome": 5,
"opera": 12,
Expand Down
1 change: 1 addition & 0 deletions test/debug-fixtures/builtins/stdout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Using plugins:
syntax-trailing-function-commas {"chrome":54,"ie":10,"node":6}

Using polyfills:
es6.typed.array-buffer {"ie":10,"node":6}
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}
Expand Down
1 change: 1 addition & 0 deletions test/debug-fixtures/electron/stdout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Using plugins:
syntax-trailing-function-commas {"electron":0.36}

Using polyfills:
es6.typed.array-buffer {"electron":0.36}
es6.typed.int8-array {"electron":0.36}
es6.typed.uint8-array {"electron":0.36}
es6.typed.uint8-clamped-array {"electron":0.36}
Expand Down
1 change: 1 addition & 0 deletions test/debug-fixtures/specific-targets/stdout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Using plugins:
syntax-trailing-function-commas {"chrome":54,"edge":13,"firefox":49,"ie":10,"ios":9,"safari":7}

Using polyfills:
es6.typed.array-buffer {"ie":10,"ios":9,"safari":7}
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}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "core-js/modules/es6.typed.array-buffer";
import "core-js/modules/es6.typed.data-view";
import "core-js/modules/es6.typed.int8-array";
import "core-js/modules/es6.typed.uint8-array";
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/preset-options/ie-11-built-ins/expected.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "core-js/modules/es6.typed.array-buffer";
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";
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/preset-options/ios-6/expected.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "core-js/modules/es6.typed.array-buffer";
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";
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/preset-options/use-builtins-all/expected.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "core-js/modules/es6.typed.array-buffer";
import "core-js/modules/es6.typed.data-view";
import "core-js/modules/es6.typed.int8-array";
import "core-js/modules/es6.typed.uint8-array";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "core-js/modules/es6.typed.array-buffer";
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";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "core-js/modules/es6.typed.array-buffer";
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";
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/preset-options/use-builtins-ie-9/actual.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "babel-polyfill";
87 changes: 87 additions & 0 deletions test/fixtures/preset-options/use-builtins-ie-9/expected.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import "core-js/modules/es6.typed.array-buffer";
import "core-js/modules/es6.typed.data-view";
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.object.set-prototype-of";
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/use-builtins-ie-9/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
["../../../../lib", {
"targets": {
"ie": 9
},
"modules": false,
"useBuiltIns": true,
"modules": false
}]
]
}

0 comments on commit 046f326

Please sign in to comment.