| 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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 void Accessors::ScriptEvalFromScriptPositionGetter( | 661 void Accessors::ScriptEvalFromScriptPositionGetter( |
| 662 v8::Local<v8::Name> name, | 662 v8::Local<v8::Name> name, |
| 663 const v8::PropertyCallbackInfo<v8::Value>& info) { | 663 const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 664 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); | 664 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); |
| 665 HandleScope scope(isolate); | 665 HandleScope scope(isolate); |
| 666 Handle<Object> object = Utils::OpenHandle(*info.This()); | 666 Handle<Object> object = Utils::OpenHandle(*info.This()); |
| 667 Handle<Script> script( | 667 Handle<Script> script( |
| 668 Script::cast(Handle<JSValue>::cast(object)->value()), isolate); | 668 Script::cast(Handle<JSValue>::cast(object)->value()), isolate); |
| 669 Handle<Object> result = isolate->factory()->undefined_value(); | 669 Handle<Object> result = isolate->factory()->undefined_value(); |
| 670 if (script->compilation_type() == Script::COMPILATION_TYPE_EVAL) { | 670 if (script->compilation_type() == Script::COMPILATION_TYPE_EVAL) { |
| 671 result = | 671 result = Handle<Object>(Smi::FromInt(script->GetEvalPosition()), isolate); |
| 672 Handle<Object>(Smi::FromInt(script->eval_from_position()), isolate); | |
| 673 } | 672 } |
| 674 info.GetReturnValue().Set(Utils::ToLocal(result)); | 673 info.GetReturnValue().Set(Utils::ToLocal(result)); |
| 675 } | 674 } |
| 676 | 675 |
| 677 | 676 |
| 678 Handle<AccessorInfo> Accessors::ScriptEvalFromScriptPositionInfo( | 677 Handle<AccessorInfo> Accessors::ScriptEvalFromScriptPositionInfo( |
| 679 Isolate* isolate, PropertyAttributes attributes) { | 678 Isolate* isolate, PropertyAttributes attributes) { |
| 680 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 679 Handle<String> name(isolate->factory()->InternalizeOneByteString( |
| 681 STATIC_CHAR_VECTOR("eval_from_script_position"))); | 680 STATIC_CHAR_VECTOR("eval_from_script_position"))); |
| 682 return MakeAccessor(isolate, name, &ScriptEvalFromScriptPositionGetter, | 681 return MakeAccessor(isolate, name, &ScriptEvalFromScriptPositionGetter, |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 Isolate* isolate = name->GetIsolate(); | 1254 Isolate* isolate = name->GetIsolate(); |
| 1256 Handle<AccessorInfo> info = MakeAccessor(isolate, name, &ModuleGetExport, | 1255 Handle<AccessorInfo> info = MakeAccessor(isolate, name, &ModuleGetExport, |
| 1257 &ModuleSetExport, attributes); | 1256 &ModuleSetExport, attributes); |
| 1258 info->set_data(Smi::FromInt(index)); | 1257 info->set_data(Smi::FromInt(index)); |
| 1259 return info; | 1258 return info; |
| 1260 } | 1259 } |
| 1261 | 1260 |
| 1262 | 1261 |
| 1263 } // namespace internal | 1262 } // namespace internal |
| 1264 } // namespace v8 | 1263 } // namespace v8 |
| OLD | NEW |