зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1631288 - Support %TypedArray%.from and %TypedArray%.of in eager evaluation. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D71667
This commit is contained in:
Родитель
5ecfef966e
Коммит
35a5b6c057
|
@ -224,6 +224,12 @@ add_task(async function() {
|
|||
setInputValue(hud, "[] instanceof Array");
|
||||
await waitForEagerEvaluationResult(hud, "true");
|
||||
|
||||
setInputValue(hud, "Int8Array.from({length: 1})[0]");
|
||||
await waitForEagerEvaluationResult(hud, "0");
|
||||
|
||||
setInputValue(hud, "Float64Array.of(1)[0]");
|
||||
await waitForEagerEvaluationResult(hud, "1");
|
||||
|
||||
// go back to inline layout.
|
||||
await toggleLayout(hud);
|
||||
});
|
||||
|
|
|
@ -16,6 +16,8 @@ function allProperties(obj) {
|
|||
return matchingProperties(obj, /./);
|
||||
}
|
||||
|
||||
const TypedArray = Reflect.getPrototypeOf(Int8Array);
|
||||
|
||||
module.exports = [
|
||||
Array,
|
||||
Array.from,
|
||||
|
@ -70,25 +72,26 @@ module.exports = [
|
|||
Uint32Array,
|
||||
Float32Array,
|
||||
Float64Array,
|
||||
// These will apply to other typed array prototypes.
|
||||
Int8Array.prototype.entries,
|
||||
Int8Array.prototype.every,
|
||||
Int8Array.prototype.filter,
|
||||
Int8Array.prototype.find,
|
||||
Int8Array.prototype.findIndex,
|
||||
Int8Array.prototype.forEach,
|
||||
Int8Array.prototype.indexOf,
|
||||
Int8Array.prototype.includes,
|
||||
Int8Array.prototype.join,
|
||||
Int8Array.prototype.keys,
|
||||
Int8Array.prototype.lastIndexOf,
|
||||
Int8Array.prototype.map,
|
||||
Int8Array.prototype.reduce,
|
||||
Int8Array.prototype.reduceRight,
|
||||
Int8Array.prototype.slice,
|
||||
Int8Array.prototype.some,
|
||||
Int8Array.prototype.subarray,
|
||||
Int8Array.prototype.values,
|
||||
TypedArray.from,
|
||||
TypedArray.of,
|
||||
TypedArray.prototype.entries,
|
||||
TypedArray.prototype.every,
|
||||
TypedArray.prototype.filter,
|
||||
TypedArray.prototype.find,
|
||||
TypedArray.prototype.findIndex,
|
||||
TypedArray.prototype.forEach,
|
||||
TypedArray.prototype.includes,
|
||||
TypedArray.prototype.indexOf,
|
||||
TypedArray.prototype.join,
|
||||
TypedArray.prototype.keys,
|
||||
TypedArray.prototype.lastIndexOf,
|
||||
TypedArray.prototype.map,
|
||||
TypedArray.prototype.reduce,
|
||||
TypedArray.prototype.reduceRight,
|
||||
TypedArray.prototype.slice,
|
||||
TypedArray.prototype.some,
|
||||
TypedArray.prototype.subarray,
|
||||
TypedArray.prototype.values,
|
||||
...allProperties(JSON),
|
||||
Map,
|
||||
Map.prototype.forEach,
|
||||
|
|
Загрузка…
Ссылка в новой задаче