aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/parsing/parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/parsing/parser.cc')
-rw-r--r--deps/v8/src/parsing/parser.cc29
1 files changed, 10 insertions, 19 deletions
diff --git a/deps/v8/src/parsing/parser.cc b/deps/v8/src/parsing/parser.cc
index 380920b8ba..2a860da3d0 100644
--- a/deps/v8/src/parsing/parser.cc
+++ b/deps/v8/src/parsing/parser.cc
@@ -15,8 +15,8 @@
#include "src/base/overflowing-math.h"
#include "src/base/platform/platform.h"
#include "src/codegen/bailout-reason.h"
+#include "src/common/message-template.h"
#include "src/compiler-dispatcher/compiler-dispatcher.h"
-#include "src/execution/message-template.h"
#include "src/logging/log.h"
#include "src/numbers/conversions-inl.h"
#include "src/objects/scope-info.h"
@@ -501,9 +501,7 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) {
Scope::DeserializationMode::kIncludingVariables);
scanner_.Initialize();
- if (FLAG_harmony_hashbang) {
- scanner_.SkipHashBang();
- }
+ scanner_.SkipHashBang();
FunctionLiteral* result = DoParseProgram(isolate, info);
MaybeResetCharacterStream(info, result);
MaybeProcessSourceRanges(info, result, stack_limit_);
@@ -1347,7 +1345,7 @@ Statement* Parser::ParseExportDeclaration() {
}
loc.end_pos = scanner()->location().end_pos;
- ModuleDescriptor* descriptor = module();
+ SourceTextModuleDescriptor* descriptor = module();
for (const AstRawString* name : names) {
descriptor->AddExport(name, name, loc, zone());
}
@@ -2783,13 +2781,15 @@ Variable* Parser::CreateSyntheticContextVariable(const AstRawString* name) {
return proxy->var();
}
-Variable* Parser::CreatePrivateNameVariable(ClassScope* scope,
- const AstRawString* name) {
+Variable* Parser::CreatePrivateNameVariable(
+ ClassScope* scope, RequiresBrandCheckFlag requires_brand_check,
+ const AstRawString* name) {
DCHECK_NOT_NULL(name);
int begin = position();
int end = end_position();
bool was_added = false;
- Variable* var = scope->DeclarePrivateName(name, &was_added);
+ Variable* var =
+ scope->DeclarePrivateName(name, requires_brand_check, &was_added);
if (!was_added) {
Scanner::Location loc(begin, end);
ReportMessageAt(loc, MessageTemplate::kVarRedeclaration, var->raw_name());
@@ -2841,7 +2841,8 @@ void Parser::DeclarePrivateClassMember(ClassScope* scope,
}
}
- Variable* private_name_var = CreatePrivateNameVariable(scope, property_name);
+ Variable* private_name_var =
+ CreatePrivateNameVariable(scope, RequiresBrandCheck(kind), property_name);
int pos = property->value()->position();
if (pos == kNoSourcePosition) {
pos = property->key()->position();
@@ -2950,16 +2951,6 @@ Expression* Parser::RewriteClassLiteral(ClassScope* block_scope,
return class_literal;
}
-bool Parser::IsPropertyWithPrivateFieldKey(Expression* expression) {
- if (!expression->IsProperty()) return false;
- Property* property = expression->AsProperty();
-
- if (!property->key()->IsVariableProxy()) return false;
- VariableProxy* key = property->key()->AsVariableProxy();
-
- return key->IsPrivateName();
-}
-
void Parser::InsertShadowingVarBindingInitializers(Block* inner_block) {
// For each var-binding that shadows a parameter, insert an assignment
// initializing the variable with the parameter.