| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 Handle<AccessorInfo> Accessors::ArrayLengthInfo( | 196 Handle<AccessorInfo> Accessors::ArrayLengthInfo( |
| 197 Isolate* isolate, PropertyAttributes attributes) { | 197 Isolate* isolate, PropertyAttributes attributes) { |
| 198 return MakeAccessor(isolate, | 198 return MakeAccessor(isolate, |
| 199 isolate->factory()->length_string(), | 199 isolate->factory()->length_string(), |
| 200 &ArrayLengthGetter, | 200 &ArrayLengthGetter, |
| 201 &ArrayLengthSetter, | 201 &ArrayLengthSetter, |
| 202 attributes); | 202 attributes); |
| 203 } | 203 } |
| 204 | 204 |
| 205 // | 205 // |
| 206 // Accessors::ModuleNamespaceToStringTag | |
| 207 // | |
| 208 | |
| 209 void Accessors::ModuleNamespaceToStringTagGetter( | |
| 210 v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { | |
| 211 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); | |
| 212 info.GetReturnValue().Set( | |
| 213 Utils::ToLocal(isolate->factory()->NewStringFromAsciiChecked("Module"))); | |
| 214 } | |
| 215 | |
| 216 Handle<AccessorInfo> Accessors::ModuleNamespaceToStringTagInfo( | |
| 217 Isolate* isolate, PropertyAttributes attributes) { | |
| 218 Handle<Name> name = isolate->factory()->to_string_tag_symbol(); | |
| 219 return MakeAccessor(isolate, name, &ModuleNamespaceToStringTagGetter, nullptr, | |
| 220 attributes); | |
| 221 } | |
| 222 | |
| 223 // | |
| 224 // Accessors::ModuleNamespaceEntry | 206 // Accessors::ModuleNamespaceEntry |
| 225 // | 207 // |
| 226 | 208 |
| 227 void Accessors::ModuleNamespaceEntryGetter( | 209 void Accessors::ModuleNamespaceEntryGetter( |
| 228 v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { | 210 v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 229 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); | 211 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); |
| 230 HandleScope scope(isolate); | 212 HandleScope scope(isolate); |
| 231 JSModuleNamespace* holder = | 213 JSModuleNamespace* holder = |
| 232 JSModuleNamespace::cast(*Utils::OpenHandle(*info.Holder())); | 214 JSModuleNamespace::cast(*Utils::OpenHandle(*info.Holder())); |
| 233 Handle<Object> result; | 215 Handle<Object> result; |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, | 1271 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, |
| 1290 PropertyAttributes attributes) { | 1272 PropertyAttributes attributes) { |
| 1291 Handle<AccessorInfo> info = | 1273 Handle<AccessorInfo> info = |
| 1292 MakeAccessor(isolate, isolate->factory()->stack_string(), | 1274 MakeAccessor(isolate, isolate->factory()->stack_string(), |
| 1293 &ErrorStackGetter, &ErrorStackSetter, attributes); | 1275 &ErrorStackGetter, &ErrorStackSetter, attributes); |
| 1294 return info; | 1276 return info; |
| 1295 } | 1277 } |
| 1296 | 1278 |
| 1297 } // namespace internal | 1279 } // namespace internal |
| 1298 } // namespace v8 | 1280 } // namespace v8 |
| OLD | NEW |