OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |