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

Side by Side Diff: src/conversions.cc

Issue 559913002: Rename ascii to one-byte where applicable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/contexts.cc ('k') | src/counters.h » ('j') | src/jsregexp.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> 5 #include <limits.h>
6 #include <stdarg.h> 6 #include <stdarg.h>
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 } 483 }
484 484
485 485
486 double StringToDouble(UnicodeCache* unicode_cache, 486 double StringToDouble(UnicodeCache* unicode_cache,
487 String* string, 487 String* string,
488 int flags, 488 int flags,
489 double empty_string_val) { 489 double empty_string_val) {
490 DisallowHeapAllocation no_gc; 490 DisallowHeapAllocation no_gc;
491 String::FlatContent flat = string->GetFlatContent(); 491 String::FlatContent flat = string->GetFlatContent();
492 // ECMA-262 section 15.1.2.3, empty string is NaN 492 // ECMA-262 section 15.1.2.3, empty string is NaN
493 if (flat.IsAscii()) { 493 if (flat.IsOneByte()) {
494 return StringToDouble( 494 return StringToDouble(
495 unicode_cache, flat.ToOneByteVector(), flags, empty_string_val); 495 unicode_cache, flat.ToOneByteVector(), flags, empty_string_val);
496 } else { 496 } else {
497 return StringToDouble( 497 return StringToDouble(
498 unicode_cache, flat.ToUC16Vector(), flags, empty_string_val); 498 unicode_cache, flat.ToUC16Vector(), flags, empty_string_val);
499 } 499 }
500 } 500 }
501 501
502 502
503 } } // namespace v8::internal 503 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/contexts.cc ('k') | src/counters.h » ('j') | src/jsregexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698