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

Side by Side Diff: src/preparser.cc

Issue 8306024: Make native syntax an early error in the preparser. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Unified enums Created 9 years, 2 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/preparser-api.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 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 return Expression::StrictFunction(); 1346 return Expression::StrictFunction();
1347 } 1347 }
1348 1348
1349 return Expression::Default(); 1349 return Expression::Default();
1350 } 1350 }
1351 1351
1352 1352
1353 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) { 1353 PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) {
1354 // CallRuntime :: 1354 // CallRuntime ::
1355 // '%' Identifier Arguments 1355 // '%' Identifier Arguments
1356
1357 Expect(i::Token::MOD, CHECK_OK); 1356 Expect(i::Token::MOD, CHECK_OK);
1357 if (!allow_natives_syntax_) {
1358 *ok = false;
1359 return Expression::Default();
1360 }
1358 ParseIdentifier(CHECK_OK); 1361 ParseIdentifier(CHECK_OK);
1359 ParseArguments(ok); 1362 ParseArguments(ok);
1360 1363
1361 return Expression::Default(); 1364 return Expression::Default();
1362 } 1365 }
1363 1366
1364 #undef CHECK_OK 1367 #undef CHECK_OK
1365 1368
1366 1369
1367 void PreParser::ExpectSemicolon(bool* ok) { 1370 void PreParser::ExpectSemicolon(bool* ok) {
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 backing_store_.Add(static_cast<byte>((ascii_length >> 14) | 0x80u)); 1683 backing_store_.Add(static_cast<byte>((ascii_length >> 14) | 0x80u));
1681 } 1684 }
1682 backing_store_.Add(static_cast<byte>((ascii_length >> 7) | 0x80u)); 1685 backing_store_.Add(static_cast<byte>((ascii_length >> 7) | 0x80u));
1683 } 1686 }
1684 backing_store_.Add(static_cast<byte>(ascii_length & 0x7f)); 1687 backing_store_.Add(static_cast<byte>(ascii_length & 0x7f));
1685 1688
1686 backing_store_.AddBlock(bytes); 1689 backing_store_.AddBlock(bytes);
1687 return backing_store_.EndSequence().start(); 1690 return backing_store_.EndSequence().start();
1688 } 1691 }
1689 } } // v8::preparser 1692 } } // v8::preparser
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | src/preparser-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698