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

Unified Diff: src/parser.cc

Issue 12095035: %X => %_X, %_X => %__X (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase and fix spacing issue Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index f6f84622e42e49386c8ad7bd8f6068ae1b1b1b3d..c444b97d3153d520bf0525a580c6f241bb84854a 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4643,11 +4643,16 @@ Expression* Parser::ParseV8Intrinsic(bool* ok) {
return NULL;
}
- // Check that the function is defined if it's an inline runtime call.
- if (function == NULL && name->Get(0) == '_') {
- ReportMessage("not_defined", Vector<Handle<String> >(&name, 1));
- *ok = false;
- return NULL;
+ if (function == NULL && name->length() > 0 && name->Get(0) == '_') {
+ // Check that the function is defined if it's an inline runtime call.
+ if (name->length() > 1 && name->Get(1) == '_') {
+ ReportMessage("not_defined", Vector<Handle<String> >(&name, 1));
+ *ok = false;
+ return NULL;
+ }
+ // Assume this is a runtime-js function called via %_name.
+ name = isolate()->factory()->NewSubString(name, 1, name->length());
Michael Starzinger 2013/01/31 15:04:53 This essentially merge the "%foo" and "%_foo" name
drcarney 2013/01/31 15:20:48 Yes, I was planning this for the patch that actual
+ name = isolate()->factory()->LookupSymbol(name);
}
// We have a valid intrinsics call or a call to a builtin.

Powered by Google App Engine
This is Rietveld 408576698