| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } | 375 } |
| 376 } | 376 } |
| 377 | 377 |
| 378 | 378 |
| 379 // Implements ECMA262 ES6 draft 21.2.5.9 | 379 // Implements ECMA262 ES6 draft 21.2.5.9 |
| 380 void Accessors::RegExpSourceGetter( | 380 void Accessors::RegExpSourceGetter( |
| 381 v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { | 381 v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 382 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); | 382 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); |
| 383 HandleScope scope(isolate); | 383 HandleScope scope(isolate); |
| 384 | 384 |
| 385 Handle<Object> receiver = | 385 Handle<Object> holder = |
| 386 Utils::OpenHandle(*v8::Local<v8::Value>(info.This())); | 386 Utils::OpenHandle(*v8::Local<v8::Value>(info.Holder())); |
| 387 Handle<JSRegExp> regexp = Handle<JSRegExp>::cast(receiver); | 387 Handle<JSRegExp> regexp = Handle<JSRegExp>::cast(holder); |
| 388 Handle<String> result; | 388 Handle<String> result; |
| 389 if (regexp->TypeTag() == JSRegExp::NOT_COMPILED) { | 389 if (regexp->TypeTag() == JSRegExp::NOT_COMPILED) { |
| 390 result = isolate->factory()->empty_string(); | 390 result = isolate->factory()->empty_string(); |
| 391 } else { | 391 } else { |
| 392 Handle<String> pattern(regexp->Pattern(), isolate); | 392 Handle<String> pattern(regexp->Pattern(), isolate); |
| 393 MaybeHandle<String> maybe = EscapeRegExpSource(isolate, pattern); | 393 MaybeHandle<String> maybe = EscapeRegExpSource(isolate, pattern); |
| 394 if (!maybe.ToHandle(&result)) { | 394 if (!maybe.ToHandle(&result)) { |
| 395 isolate->OptionalRescheduleException(false); | 395 isolate->OptionalRescheduleException(false); |
| 396 return; | 396 return; |
| 397 } | 397 } |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1494 info->set_data(Smi::FromInt(index)); | 1494 info->set_data(Smi::FromInt(index)); |
| 1495 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1495 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
| 1496 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1496 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
| 1497 info->set_getter(*getter); | 1497 info->set_getter(*getter); |
| 1498 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1498 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
| 1499 return info; | 1499 return info; |
| 1500 } | 1500 } |
| 1501 | 1501 |
| 1502 | 1502 |
| 1503 } } // namespace v8::internal | 1503 } } // namespace v8::internal |
| OLD | NEW |