Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index bb3874d9e39fc91dc9fbdc40ea1a88b24ff3efb4..cff4d5dd96f0152129190c875d7b6b174f055707 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -359,7 +359,6 @@ FunctionLiteral* Parser::DefaultConstructor(bool call_super, Scope* scope, |
kind, &function_factory); |
body = new (zone()) ZoneList<Statement*>(call_super ? 2 : 1, zone()); |
- AddAssertIsConstruct(body, pos); |
if (call_super) { |
// %_DefaultConstructorCallSuper(new.target, %GetPrototype(<this-fun>)) |
ZoneList<Expression*>* args = |
@@ -4476,21 +4475,6 @@ void Parser::SkipLazyFunctionBody(int* materialized_literal_count, |
} |
-void Parser::AddAssertIsConstruct(ZoneList<Statement*>* body, int pos) { |
- ZoneList<Expression*>* arguments = |
- new (zone()) ZoneList<Expression*>(0, zone()); |
- CallRuntime* construct_check = factory()->NewCallRuntime( |
- Runtime::kInlineIsConstructCall, arguments, pos); |
- CallRuntime* non_callable_error = factory()->NewCallRuntime( |
- Runtime::kThrowConstructorNonCallableError, arguments, pos); |
- IfStatement* if_statement = factory()->NewIfStatement( |
- factory()->NewUnaryOperation(Token::NOT, construct_check, pos), |
- factory()->NewReturnStatement(non_callable_error, pos), |
- factory()->NewEmptyStatement(pos), pos); |
- body->Add(if_statement, zone()); |
-} |
- |
- |
Statement* Parser::BuildAssertIsCoercible(Variable* var) { |
// if (var === null || var === undefined) |
// throw /* type error kNonCoercible) */; |
@@ -4684,12 +4668,6 @@ ZoneList<Statement*>* Parser::ParseEagerFunctionBody( |
result->Add(NULL, zone()); |
} |
- // For concise constructors, check that they are constructed, |
- // not called. |
- if (IsClassConstructor(kind)) { |
- AddAssertIsConstruct(result, pos); |
- } |
- |
ZoneList<Statement*>* body = result; |
Scope* inner_scope = scope_; |
Block* inner_block = nullptr; |