Chromium Code Reviews| 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. |