-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GR-54881] %TypedArray%.prototype.map should use Set (not CreateDataP…
…ropertyOrThrow). PullRequest: js/3182
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. | ||
*/ | ||
|
||
// Checks that %TypedArray%.prototype.map uses Set (not CreateDataPropertyOrThrow) | ||
|
||
load("assert.js"); | ||
|
||
var buffer = new ArrayBuffer(8); | ||
var array = new Uint8Array(buffer); | ||
var ctor = function() { return array; }; | ||
ctor[Symbol.species] = ctor; | ||
array.constructor = ctor; | ||
|
||
var calls = 0; | ||
array.map(function(_,i) { | ||
calls++; | ||
if (i === 1) buffer.transfer(); | ||
}); | ||
|
||
assertSame(8, calls); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters