OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 if (!AdvanceToNonspace(unicode_cache, ¤t, end)) { | 247 if (!AdvanceToNonspace(unicode_cache, ¤t, end)) { |
248 return empty_string_val; | 248 return empty_string_val; |
249 } | 249 } |
250 | 250 |
251 bool negative = false; | 251 bool negative = false; |
252 bool leading_zero = false; | 252 bool leading_zero = false; |
253 | 253 |
254 if (*current == '+') { | 254 if (*current == '+') { |
255 // Ignore leading sign; skip following spaces. | 255 // Ignore leading sign; skip following spaces. |
256 ++current; | 256 ++current; |
257 if (!AdvanceToNonspace(unicode_cache, ¤t, end)) { | 257 if (current == end) { |
258 return JUNK_STRING_VALUE; | 258 return JUNK_STRING_VALUE; |
259 } | 259 } |
260 } else if (*current == '-') { | 260 } else if (*current == '-') { |
261 ++current; | 261 ++current; |
262 if (!AdvanceToNonspace(unicode_cache, ¤t, end)) { | 262 if (current == end) { |
263 return JUNK_STRING_VALUE; | 263 return JUNK_STRING_VALUE; |
264 } | 264 } |
265 negative = true; | 265 negative = true; |
266 } | 266 } |
267 | 267 |
268 if (radix == 0) { | 268 if (radix == 0) { |
269 // Radix detection. | 269 // Radix detection. |
270 if (*current == '0') { | 270 if (*current == '0') { |
271 ++current; | 271 ++current; |
272 if (current == end) return SignedZero(negative); | 272 if (current == end) return SignedZero(negative); |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 (n == 0 ? v8::internal::dtoa_lock_zero : v8::internal::dtoa_lock_one)->Lock(); | 1113 (n == 0 ? v8::internal::dtoa_lock_zero : v8::internal::dtoa_lock_one)->Lock(); |
1114 } | 1114 } |
1115 | 1115 |
1116 | 1116 |
1117 void FREE_DTOA_LOCK(int n) { | 1117 void FREE_DTOA_LOCK(int n) { |
1118 ASSERT(n == 0 || n == 1); | 1118 ASSERT(n == 0 || n == 1); |
1119 (n == 0 ? v8::internal::dtoa_lock_zero : v8::internal::dtoa_lock_one)-> | 1119 (n == 0 ? v8::internal::dtoa_lock_zero : v8::internal::dtoa_lock_one)-> |
1120 Unlock(); | 1120 Unlock(); |
1121 } | 1121 } |
1122 } | 1122 } |
OLD | NEW |