[Webkit-unassigned] [Bug 159385] ECMAScript 2016: %TypedArray%.prototype.includes implementation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 8 01:45:16 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=159385

--- Comment #36 from Benjamin Poulain <benjamin at webkit.org> ---
(In reply to comment #34)
> (In reply to comment #33)
> > You seem to have trouble getting test expectations.
> > 
> > What's your workflow to get them?
> 
> Yes, it was a painful process. I built all the webkit and un the test in
> Safari to get the output. After that I changed the file with the current
> output but I missed the newline. I uploaded the Patch to check if it was ok,
> because When I tried to run "run-webkit-test" in the morning, the webkit
> started compile from scratch agin...Now it is fixed (at least localhost) and
> I am going to check if the win build is not going to fail.

Ok.

Here are two ways you can update the expectations:

If you build the full WebKit (sometimes necessary, not always), you can run the test you want and use --reset-results.
For example, in your case you can do:
    ./Tools/Scripts/run-webkit-test js/typed-array-includes.html --reset-results
This will run the test and replace the -expected.txt file of that test.
(Note that the command takes the path to the test without "LayoutTest" in front, which is a bit weird)


If you do not need to run any of the WebKit test, you can sometime get away with just building JavaScript.
What you do then is run the script with standalone-pre.js and standalone-post.js. For example for your new test I would try:
    DYLD_FRAMEWORK_PATH=./WebKitBuild/Release/ ./WebKitBuild/Release/jsc LayoutTest/resources/standalone-pre.js LayoutTests/js/script-tests/typed-array-includes.js LayoutTest/resources/standalone-post.js  > LayoutTests/js/typed-array-includes-expected.txt

A bit ugly, but it gets the job done.

> BTW, I faced a strange behavior...Even with new Float(32|64)Array([NaN]),
> when searchValue=NaN and I perform a loop through elements, array[i] = NaN
> and target = NaN but array[i] == target returns false...Can you explain it?

I am not certain to understand the question but if you are wondering about NaN equality...:

If you do NaN === NaN, that's false. A NaN is not equal to itself (or any other number).
Even in C, if you have
    double value = NaN;
    (value == value) -> This is false.

Since NaN is not a number, comparing it to anything is false.
In practice, CPUs have two kinds of comparisons: ordered and unordered.
-Ordered comparison is true if neither operands are NaN.
-An unordered comparison is true if either operands are NaN.
If you look at the "DoubleCondition" enum in any of the MacroAssembler, you'll get an idea of what comparison operator are available.

---

If I misunderstood your question: can you give an complete example?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160708/7d9e7c86/attachment.html>


More information about the webkit-unassigned mailing list