From e2b5c3bbced00dd74c777043fc2611cbc41b4a2e Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Wed, 7 Aug 2024 21:27:05 +0300 Subject: [PATCH] Update test262 test suite and fix TypedArray.set issues (#1934) --- Jint.Tests.Test262/Test262Harness.settings.json | 4 +++- Jint/Native/TypedArray/IntrinsicTypedArrayPrototype.cs | 8 +++++++- README.md | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Jint.Tests.Test262/Test262Harness.settings.json b/Jint.Tests.Test262/Test262Harness.settings.json index 3a024d97e..406010a5b 100644 --- a/Jint.Tests.Test262/Test262Harness.settings.json +++ b/Jint.Tests.Test262/Test262Harness.settings.json @@ -1,5 +1,5 @@ { - "SuiteGitSha": "242f6f98f0f86c0a3276929b4a450438526057cb", + "SuiteGitSha": "5dc04b733275cf64e3022867359e27bc99d9262c", //"SuiteDirectory": "//mnt/c/work/test262", "TargetPath": "./Generated", "Namespace": "Jint.Tests.Test262", @@ -9,6 +9,7 @@ "async-iteration", "Atomics", "decorators", + "explicit-resource-management", "import-assertions", "iterator-helpers", "Math.sumPrecise", @@ -43,6 +44,7 @@ "language/literals/regexp/named-groups/forward-reference.js", // RegExp handling problems + "built-ins/RegExp/nullable-quantifier.js", "built-ins/RegExp/prototype/exec/S15.10.6.2_A1_T6.js", "language/literals/regexp/u-case-mapping.js", "built-ins/RegExp/lookahead-quantifier-match-groups.js", diff --git a/Jint/Native/TypedArray/IntrinsicTypedArrayPrototype.cs b/Jint/Native/TypedArray/IntrinsicTypedArrayPrototype.cs index 5394a97e4..8096f5162 100644 --- a/Jint/Native/TypedArray/IntrinsicTypedArrayPrototype.cs +++ b/Jint/Native/TypedArray/IntrinsicTypedArrayPrototype.cs @@ -1125,7 +1125,13 @@ private void SetTypedArrayFromArrayLike(JsTypedArray target, int targetOffset, J var targetBuffer = target._viewedArrayBuffer; targetBuffer.AssertNotDetached(); - var targetLength = target._arrayLength; + var targetRecord = MakeTypedArrayWithBufferWitnessRecord(target, ArrayBufferOrder.SeqCst); + if (targetRecord.IsTypedArrayOutOfBounds) + { + ExceptionHelper.ThrowTypeError(_realm); + } + + var targetLength = targetRecord.TypedArrayLength; var src = ArrayOperations.For(_realm, source, forWrite: false); var srcLength = src.GetLength(); diff --git a/README.md b/README.md index 0f90ca127..f4efb2e97 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ and many more. #### ECMAScript 2017 - ✔ `Object.values`, `Object.entries` and `Object.getOwnPropertyDescriptors` +- ❌ Shared memory and atomics #### ECMAScript 2018