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

Side by Side Diff: src/accessors.cc

Issue 1377603006: [es6] Function constructor-created functions should be named "anonymous" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/accessors.h" 5 #include "src/accessors.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/contexts.h" 8 #include "src/contexts.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/execution.h" 10 #include "src/execution.h"
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 // 1067 //
1068 1068
1069 1069
1070 void Accessors::FunctionNameGetter( 1070 void Accessors::FunctionNameGetter(
1071 v8::Local<v8::Name> name, 1071 v8::Local<v8::Name> name,
1072 const v8::PropertyCallbackInfo<v8::Value>& info) { 1072 const v8::PropertyCallbackInfo<v8::Value>& info) {
1073 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); 1073 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
1074 HandleScope scope(isolate); 1074 HandleScope scope(isolate);
1075 Handle<JSFunction> function = 1075 Handle<JSFunction> function =
1076 Handle<JSFunction>::cast(Utils::OpenHandle(*info.Holder())); 1076 Handle<JSFunction>::cast(Utils::OpenHandle(*info.Holder()));
1077 Handle<Object> result(function->shared()->name(), isolate); 1077 Handle<Object> result;
1078 if (function->shared()->name_should_print_as_anonymous()) {
1079 result = isolate->factory()->anonymous_string();
1080 } else {
1081 result = handle(function->shared()->name(), isolate);
1082 }
1078 info.GetReturnValue().Set(Utils::ToLocal(result)); 1083 info.GetReturnValue().Set(Utils::ToLocal(result));
1079 } 1084 }
1080 1085
1081 1086
1082 MUST_USE_RESULT static MaybeHandle<Object> SetFunctionName( 1087 MUST_USE_RESULT static MaybeHandle<Object> SetFunctionName(
1083 Isolate* isolate, Handle<JSFunction> function, Handle<Object> value) { 1088 Isolate* isolate, Handle<JSFunction> function, Handle<Object> value) {
1084 Handle<Object> old_value; 1089 Handle<Object> old_value;
1085 bool is_observed = function->map()->is_observed(); 1090 bool is_observed = function->map()->is_observed();
1086 if (is_observed) { 1091 if (is_observed) {
1087 old_value = handle(function->shared()->name(), isolate); 1092 old_value = handle(function->shared()->name(), isolate);
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 1510 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
1506 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 1511 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
1507 info->set_getter(*getter); 1512 info->set_getter(*getter);
1508 if (!(attributes & ReadOnly)) info->set_setter(*setter); 1513 if (!(attributes & ReadOnly)) info->set_setter(*setter);
1509 return info; 1514 return info;
1510 } 1515 }
1511 1516
1512 1517
1513 } // namespace internal 1518 } // namespace internal
1514 } // namespace v8 1519 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698