Skip to content

Commit 95fc85d

Browse files
committed
fix ArrayBuffer.length in V8 ~ Chrome 27-
1 parent c9aff1b commit 95fc85d

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Avoid unnecessary promise creation and do not validate result in `%WrapForValid(Async)IteratorPrototype%.return`, [proposal-iterator-helpers/215](https://github.com/tc39/proposal-iterator-helpers/pull/215)
55
- Fixed the order creation of properties of iteration result object of some iterators (`value` should be created before `done`)
66
- Fixed some cases of Safari < 13 bug - silent on non-writable array `.length` setting
7+
- Fixed `ArrayBuffer.length` in V8 ~ Chrome 27-
78
- Relaxed condition of re-usage native `WeakMap` for internal states with multiple `core-js` copies
89
- Availability cloning of `FileList` in the `structuredClone` polyfill extended to some more old engines versions
910
- Some stylistic changes

packages/core-js-compat/src/data.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ export const data = {
448448
},
449449
'es.array-buffer.constructor': {
450450
bun: '0.1.1',
451-
chrome: '26',
451+
chrome: '28',
452452
edge: '14',
453453
firefox: '44',
454454
hermes: '0.1',

packages/core-js/internals/array-buffer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ if (!NATIVE_ARRAY_BUFFER) {
197197
new NativeArrayBuffer();
198198
new NativeArrayBuffer(1.5);
199199
new NativeArrayBuffer(NaN);
200-
return INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
200+
return NativeArrayBuffer.length != 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
201201
})) {
202-
/* eslint-enable no-new -- required for testing */
202+
/* eslint-enable no-new -- required for testing */
203203
$ArrayBuffer = function ArrayBuffer(length) {
204204
anInstance(this, ArrayBufferPrototype);
205205
return new NativeArrayBuffer(toIndex(length));

tests/compat/tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ GLOBAL.tests = {
544544
new ArrayBuffer();
545545
new ArrayBuffer(1.5);
546546
new ArrayBuffer(NaN);
547-
return ArrayBuffer.name == 'ArrayBuffer';
547+
return ArrayBuffer.length == 1 && ArrayBuffer.name == 'ArrayBuffer';
548548
}],
549549
'es.array-buffer.is-view': [ARRAY_BUFFER_VIEWS_SUPPORT, function () {
550550
return ArrayBuffer.isView;

0 commit comments

Comments
 (0)