Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index c14f2930d1042b71d152053b9b52a45b19199c1b..65d1c5916d74d552dca0dc8ceb018eb4f2f365bd 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -6150,7 +6150,7 @@ Expression* ParserTraits::RewriteInstanceof(Expression* lhs, Expression* rhs, |
Expression* call = |
NewThrowTypeError(MessageTemplate::kNonObjectInInstanceOfCheck, |
avfactory->empty_string(), pos); |
- Statement* throw_call = factory->NewExpressionStatement(call, nopos); |
+ Statement* throw_call = factory->NewExpressionStatement(call, pos); |
validate_C = |
factory->NewIfStatement(is_receiver_call, |
@@ -6193,7 +6193,7 @@ Expression* ParserTraits::RewriteInstanceof(Expression* lhs, Expression* rhs, |
Expression* throw_expr = |
NewThrowTypeError(MessageTemplate::kCalledNonCallableInstanceOf, |
avfactory->empty_string(), pos); |
- Statement* validate_C = CheckCallable(var_C, throw_expr); |
+ Statement* validate_C = CheckCallable(var_C, throw_expr, pos); |
ZoneList<Expression*>* empty_args = |
new (zone) ZoneList<Expression*>(0, zone); |
@@ -6262,7 +6262,8 @@ Expression* ParserTraits::RewriteInstanceof(Expression* lhs, Expression* rhs, |
return instanceof; |
} |
-Statement* ParserTraits::CheckCallable(Variable* var, Expression* error) { |
+Statement* ParserTraits::CheckCallable(Variable* var, Expression* error, |
+ int pos) { |
auto factory = parser_->factory(); |
auto avfactory = parser_->ast_value_factory(); |
const int nopos = RelocInfo::kNoPosition; |
@@ -6275,7 +6276,7 @@ Statement* ParserTraits::CheckCallable(Variable* var, Expression* error) { |
Expression* condition = factory->NewCompareOperation( |
Token::EQ_STRICT, type_of, function_literal, nopos); |
- Statement* throw_call = factory->NewExpressionStatement(error, nopos); |
+ Statement* throw_call = factory->NewExpressionStatement(error, pos); |
validate_var = factory->NewIfStatement( |
condition, factory->NewEmptyStatement(nopos), throw_call, nopos); |
@@ -6554,7 +6555,7 @@ void ParserTraits::BuildIteratorCloseForCompletion( |
Expression* throw_expr = NewThrowTypeError( |
MessageTemplate::kReturnMethodNotCallable, |
avfactory->empty_string(), nopos); |
- check_return_callable = CheckCallable(var_return, throw_expr); |
+ check_return_callable = CheckCallable(var_return, throw_expr, nopos); |
} |
// try { %_Call(iteratorReturn, iterator) } catch (_) { } |