Fixes #6031 The assert itself doesn't repro. However, ReverseHelper fails to recognize that this could be a TypedArray and seems to fail earlier than it should unable to find the Reverse method.#6280
Conversation
…rseHelper fails to recognize that this could be a TypedArray and seems to fail earlier than it should unable to find the Reverse method.
| bool isTypedArrayEntryPoint = typedArrayBase != nullptr; | ||
|
|
||
| // If we came from Array.prototype.map and source object is not a JavascriptArray, source could be a TypedArray | ||
| if (typedArrayBase == nullptr && pArr == nullptr && VarIs<TypedArrayBase>(obj)) |
There was a problem hiding this comment.
Is the effect of moving this up just to change the methodName below, or is there something else?
There was a problem hiding this comment.
There was a problem hiding this comment.
Would this name still be correct if we did something like Array.prototype.reverse.call(new Int8Array(2)) ? We're going to think the entry point was %TypedArray%.prototype.reverse, right?
There was a problem hiding this comment.
Yes, it will be %TypedArray%.prototype.reverse. Is that not correct?
In reply to: 323489092 [](ancestors = 323489092)
There was a problem hiding this comment.
If you call Array.prototype.reverse (regardless of what you call it with) it should probably report that name in any error messages.
There was a problem hiding this comment.
Yeah. The error message text is not spec'd but we want the name reported to match the actual entrypoint called - they're differently named functions in the spec, after all.
There was a problem hiding this comment.
Unless, there is a strong preference on the error message I will make this change. Let me know.
In reply to: 323510851 [](ancestors = 323510851)
There was a problem hiding this comment.
I think we should probably stick with the current method of determining the methodName?
There was a problem hiding this comment.
But that does cause a functional issue. In this particular case we will fail prematurely on Line#5620 as we will not find the method "Array.prototype.reverse"
const var_0 = new Uint8Array([1, 2, 3, 4]);
Object.defineProperty(var_0, 'length', { value: 4398046507008 });
Array.prototype.reverse.call(var_0);
In reply to: 324277790 [](ancestors = 324277790)
No description provided.