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

Side by Side Diff: src/preparser.cc

Issue 19300002: ES6: Add support for explicit octal and binary integer literals (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix long lines Created 7 years, 5 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/preparser.h ('k') | src/runtime.cc » ('j') | no next file with comments »
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 // 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 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 } 1717 }
1718 1718
1719 1719
1720 int DuplicateFinder::AddNumber(i::Vector<const char> key, int value) { 1720 int DuplicateFinder::AddNumber(i::Vector<const char> key, int value) {
1721 ASSERT(key.length() > 0); 1721 ASSERT(key.length() > 0);
1722 // Quick check for already being in canonical form. 1722 // Quick check for already being in canonical form.
1723 if (IsNumberCanonical(key)) { 1723 if (IsNumberCanonical(key)) {
1724 return AddAsciiSymbol(key, value); 1724 return AddAsciiSymbol(key, value);
1725 } 1725 }
1726 1726
1727 int flags = i::ALLOW_HEX | i::ALLOW_OCTALS; 1727 int flags = i::ALLOW_HEX | i::ALLOW_OCTAL | i::ALLOW_IMPLICIT_OCTAL |
1728 i::ALLOW_BINARY;
1728 double double_value = StringToDouble(unicode_constants_, key, flags, 0.0); 1729 double double_value = StringToDouble(unicode_constants_, key, flags, 0.0);
1729 int length; 1730 int length;
1730 const char* string; 1731 const char* string;
1731 if (!std::isfinite(double_value)) { 1732 if (!std::isfinite(double_value)) {
1732 string = "Infinity"; 1733 string = "Infinity";
1733 length = 8; // strlen("Infinity"); 1734 length = 8; // strlen("Infinity");
1734 } else { 1735 } else {
1735 string = DoubleToCString(double_value, 1736 string = DoubleToCString(double_value,
1736 i::Vector<char>(number_buffer_, kBufferSize)); 1737 i::Vector<char>(number_buffer_, kBufferSize));
1737 length = i::StrLength(string); 1738 length = i::StrLength(string);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 backing_store_.Add(static_cast<byte>((ascii_length >> 14) | 0x80u)); 1823 backing_store_.Add(static_cast<byte>((ascii_length >> 14) | 0x80u));
1823 } 1824 }
1824 backing_store_.Add(static_cast<byte>((ascii_length >> 7) | 0x80u)); 1825 backing_store_.Add(static_cast<byte>((ascii_length >> 7) | 0x80u));
1825 } 1826 }
1826 backing_store_.Add(static_cast<byte>(ascii_length & 0x7f)); 1827 backing_store_.Add(static_cast<byte>(ascii_length & 0x7f));
1827 1828
1828 backing_store_.AddBlock(bytes); 1829 backing_store_.AddBlock(bytes);
1829 return backing_store_.EndSequence().start(); 1830 return backing_store_.EndSequence().start();
1830 } 1831 }
1831 } } // v8::preparser 1832 } } // v8::preparser
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698