Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: test/mjsunit/parse-int-float.js

Issue 124573002: Upgrade Number constructor to ES6. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/v8natives.js ('K') | « test/mjsunit/number-is.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 try { parseInt('123', throwingRadix); } catch (e) {} 107 try { parseInt('123', throwingRadix); } catch (e) {}
108 assertEquals(state, "throwingRadix"); 108 assertEquals(state, "throwingRadix");
109 109
110 state = null; 110 state = null;
111 try { parseInt(throwingString, 10); } catch (e) {} 111 try { parseInt(throwingString, 10); } catch (e) {}
112 assertEquals(state, "throwingString"); 112 assertEquals(state, "throwingString");
113 113
114 state = null; 114 state = null;
115 try { parseInt(throwingString, throwingRadix); } catch (e) {} 115 try { parseInt(throwingString, throwingRadix); } catch (e) {}
116 assertEquals(state, "throwingString"); 116 assertEquals(state, "throwingString");
117
118 // And finally, check that the Harmony additions to the Number
119 // constructor is available:
120 assertTrue("parseInt" in Number);
121 assertTrue("parseFloat" in Number);
122 assertEquals(Number.parseFloat('0.1'), parseFloat('0.1'));
Michael Starzinger 2014/01/07 16:08:00 The spec requires "Number.parseFloat" and "parseFl
sof 2014/01/07 21:36:29 Added
123 assertEquals(Number.parseInt('0xea'), parseInt('0xEA'));
OLDNEW
« src/v8natives.js ('K') | « test/mjsunit/number-is.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698