Skip to content

Commit b931062

Browse files
committed
temporarily revert change the order of operations in %TypedArray%.prototype.with
1 parent 0460543 commit b931062

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
## Changelog
22
##### Unreleased
3-
- Changed the order of operations in `%TypedArray%.prototype.with` following [proposal-change-array-by-copy/86](https://github.com/tc39/proposal-change-array-by-copy/issues/86)
43
- Fixed possible multiple call of `ToBigInt` / `ToNumber` conversion of the argument passed to `%TypedArray%.prototype.fill` in V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18
54
- Fixed some cases of `DeletePropertyOrThrow` in IE9-
65
- Fixed the kind of error (`TypeError` instead of `Error`) on incorrect `exec` result in `RegExp.prototype.test` polyfill
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
'use strict';
22
var arrayWith = require('../internals/array-with');
33
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
4-
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
5-
var toBigInt = require('../internals/to-big-int');
6-
var classof = require('../internals/classof');
7-
var uncurryThis = require('../internals/function-uncurry-this');
4+
// var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
5+
// var toBigInt = require('../internals/to-big-int');
6+
// var classof = require('../internals/classof');
7+
// var uncurryThis = require('../internals/function-uncurry-this');
88

99
var aTypedArray = ArrayBufferViewCore.aTypedArray;
1010
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
1111
var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
12-
var slice = uncurryThis(''.slice);
12+
// var slice = uncurryThis(''.slice);
1313

1414
// `%TypedArray%.prototype.with` method
1515
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with
1616
exportTypedArrayMethod('with', { 'with': function (index, value) {
17-
aTypedArray(this);
18-
var relativeIndex = toIntegerOrInfinity(index);
19-
var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;
20-
return arrayWith(this, this[TYPED_ARRAY_CONSTRUCTOR], relativeIndex, actualValue);
17+
// aTypedArray(this);
18+
// var relativeIndex = toIntegerOrInfinity(index);
19+
// var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;
20+
// return arrayWith(this, this[TYPED_ARRAY_CONSTRUCTOR], relativeIndex, actualValue);
21+
return arrayWith(aTypedArray(this), this[TYPED_ARRAY_CONSTRUCTOR], index, value);
2122
} }['with']);

0 commit comments

Comments
 (0)