Closed
Bug 1079120
Opened 10 years ago
Closed 10 years ago
Make ToNumber(string) support binary and octal literals
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: 446240525, Assigned: 446240525)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])
Attachments
(1 file)
3.34 KB,
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
>Number('0b11') // 3
>Number('0o77') // 63
https://bugs.ecmascript.org/show_bug.cgi?id=1584
https://bugs.ecmascript.org/show_bug.cgi?id=3259
Assignee: nobody → 446240525
Attachment #8500921 -
Flags: review?(till)
Comment 2•10 years ago
|
||
Comment on attachment 8500921 [details] [diff] [review]
bug-1079120.patch
Review of attachment 8500921 [details] [diff] [review]:
-----------------------------------------------------------------
This looks great, thanks!
I'm not sufficiently convinced it is web compatible to just land it, though. Asking jorendorff for a decision on that. Please hold off on landing until then.
::: js/src/tests/ecma_6/Number/ToNumber.js
@@ +18,5 @@
> +assertEq(+"0o66", 54);
> +
> +if(typeof getSelfHostedValue === "function"){
> + assertEq(getSelfHostedValue("ToNumber")("0b11"), 3);
> + assertEq(getSelfHostedValue("ToNumber")("0o66"), 54);
Nice!
Attachment #8500921 -
Flags: review?(till)
Attachment #8500921 -
Flags: review+
Attachment #8500921 -
Flags: feedback?(jorendorff)
Comment 3•10 years ago
|
||
I am pretty sure this is web compatible, Chrome seems to have this already.
(In reply to Tom Schuster [:evilpie] from comment #3)
> I am pretty sure this is web compatible, Chrome seems to have this already.
Chrome has experimented this for one year, and seems no breakage reported so far.
https://codereview.chromium.org/19300002
https://codereview.chromium.org/626153002
Comment 5•10 years ago
|
||
Comment on attachment 8500921 [details] [diff] [review]
bug-1079120.patch
Review of attachment 8500921 [details] [diff] [review]:
-----------------------------------------------------------------
> Chrome has experimented this for one year, and seems no breakage reported so far.
Ok, that does convince me; let's land this.
ziyunfei, can you make sure the patch still applies and passes tests and then set checkin-needed?
::: js/src/tests/ecma_6/Number/ToNumber.js
@@ +18,5 @@
> +assertEq(+"0o66", 54);
> +
> +if(typeof getSelfHostedValue === "function"){
> + assertEq(getSelfHostedValue("ToNumber")("0b11"), 3);
> + assertEq(getSelfHostedValue("ToNumber")("0o66"), 54);
Nice!
Attachment #8500921 -
Flags: feedback?(jorendorff)
Comment 7•10 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in
before you can comment on or make changes to this bug.
Description
•