Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: src/factory.cc

Issue 160073006: Implement handling of arrow functions in the parser (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased after latest changes in runtime.{h,cc} Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | src/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 3aacc59d503673d627955e79d590acb3a1f066bb..a6704f364820afd3e33c7225e7fab9960fd3c345 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1788,11 +1788,13 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
Handle<String> name,
int number_of_literals,
bool is_generator,
+ bool is_arrow,
Handle<Code> code,
Handle<ScopeInfo> scope_info) {
Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name);
shared->set_code(*code);
shared->set_scope_info(*scope_info);
+ shared->set_is_arrow(is_arrow);
int literals_array_size = number_of_literals;
// If the function contains object, regexp or array literals,
// allocate extra space for a literals array prefix containing the
@@ -1990,7 +1992,7 @@ void Factory::InitializeFunction(Handle<JSFunction> function,
static Handle<Map> MapForNewFunction(Isolate* isolate,
Handle<SharedFunctionInfo> function_info,
MaybeHandle<Object> maybe_prototype) {
- if (maybe_prototype.is_null()) {
+ if (maybe_prototype.is_null() || function_info->is_arrow()) {
return function_info->strict_mode() == SLOPPY
? isolate->sloppy_function_without_prototype_map()
: isolate->strict_function_without_prototype_map();
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698