Commit e8fa381
[JSC] Align
https://bugs.webkit.org/show_bug.cgi?id=304149
Reviewed by Yusuke Suzuki and Sosuke Suzuki.
This patch fixes `%TypedArray%.prototype.includes`
by adding range check to ensure the `index` is less than the array length,
aligning the behavior with ECMA-262[1].
[1]: https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes
Test: JSTests/stress/typedarray-resize-includes.js
* JSTests/stress/typedarray-resize-includes.js: Added.
(shouldBe):
(throw.new.Error):
* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncIncludes):
Canonical link: https://commits.webkit.org/304485@main%TypedArray%.prototype.includes with ECMA-2621 parent dfea1c8 commit e8fa381
File tree
3 files changed
+38
-4
lines changed- JSTests
- stress
- test262
- Source/JavaScriptCore/runtime
3 files changed
+38
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | 412 | | |
416 | 413 | | |
417 | 414 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | | - | |
| 458 | + | |
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
| |||
0 commit comments