| Index: src/parser.cc
|
| diff --git a/src/parser.cc b/src/parser.cc
|
| index 29b1fe74c6058a344f12d75e5d9407f0b86d1ae6..722e374f72a4f1554172ce4ed24d2e25b61d8229 100644
|
| --- a/src/parser.cc
|
| +++ b/src/parser.cc
|
| @@ -4627,7 +4627,7 @@ Expression* Parser::ParseV8Intrinsic(bool* ok) {
|
| function->function_id == Runtime::kIS_VAR) {
|
| // %IS_VAR(x) evaluates to x if x is a variable,
|
| // leads to a parse error otherwise. Could be implemented as an
|
| - // inline function %_IS_VAR(x) to eliminate this special case.
|
| + // inline function %__IS_VAR(x) to eliminate this special case.
|
| if (args->length() == 1 && args->at(0)->AsVariableProxy() != NULL) {
|
| return args->at(0);
|
| } else {
|
| @@ -4646,11 +4646,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());
|
| + name = isolate()->factory()->LookupSymbol(name);
|
| }
|
|
|
| // We have a valid intrinsics call or a call to a builtin.
|
|
|