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

Side by Side Diff: src/parser.cc

Issue 7206022: Made parser not accept unicode escapes inside "native" when used as a keyword. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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 | « no previous file | test/cctest/test-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 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 1773
1774 // If we have an extension, we allow a native function declaration. 1774 // If we have an extension, we allow a native function declaration.
1775 // A native function declaration starts with "native function" with 1775 // A native function declaration starts with "native function" with
1776 // no line-terminator between the two words. 1776 // no line-terminator between the two words.
1777 if (extension_ != NULL && 1777 if (extension_ != NULL &&
1778 peek() == Token::FUNCTION && 1778 peek() == Token::FUNCTION &&
1779 !scanner().has_line_terminator_before_next() && 1779 !scanner().has_line_terminator_before_next() &&
1780 expr != NULL && 1780 expr != NULL &&
1781 expr->AsVariableProxy() != NULL && 1781 expr->AsVariableProxy() != NULL &&
1782 expr->AsVariableProxy()->name()->Equals( 1782 expr->AsVariableProxy()->name()->Equals(
1783 isolate()->heap()->native_symbol())) { 1783 isolate()->heap()->native_symbol()) &&
1784 !scanner().literal_contains_escapes()) {
1784 return ParseNativeDeclaration(ok); 1785 return ParseNativeDeclaration(ok);
1785 } 1786 }
1786 1787
1787 // Parsed expression statement. 1788 // Parsed expression statement.
1788 ExpectSemicolon(CHECK_OK); 1789 ExpectSemicolon(CHECK_OK);
1789 return new(zone()) ExpressionStatement(expr); 1790 return new(zone()) ExpressionStatement(expr);
1790 } 1791 }
1791 1792
1792 1793
1793 IfStatement* Parser::ParseIfStatement(ZoneStringList* labels, bool* ok) { 1794 IfStatement* Parser::ParseIfStatement(ZoneStringList* labels, bool* ok) {
(...skipping 3213 matching lines...) Expand 10 before | Expand all | Expand 10 after
5007 info->is_global(), 5008 info->is_global(),
5008 info->StrictMode()); 5009 info->StrictMode());
5009 } 5010 }
5010 } 5011 }
5011 5012
5012 info->SetFunction(result); 5013 info->SetFunction(result);
5013 return (result != NULL); 5014 return (result != NULL);
5014 } 5015 }
5015 5016
5016 } } // namespace v8::internal 5017 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698