Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index e4f165ae44e5e64051c8ea176e5687b6869ef11b..5690e9ae5411db7eca1dac94983ab9cdf64075a2 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -7615,13 +7615,12 @@ bool SharedFunctionInfo::HasSourceCode() { |
} |
-Object* SharedFunctionInfo::GetSourceCode() { |
- Isolate* isolate = GetIsolate(); |
- if (!HasSourceCode()) return isolate->heap()->undefined_value(); |
- HandleScope scope(isolate); |
- Object* source = Script::cast(script())->source(); |
- return *SubString(Handle<String>(String::cast(source), isolate), |
- start_position(), end_position()); |
+Handle<Object> SharedFunctionInfo::GetSourceCode() { |
+ if (!HasSourceCode()) { |
+ return Handle<Object>(GetIsolate()->heap()->undefined_value()); |
Kevin Millikin (Chromium)
2012/02/09 08:01:51
You should write this as
return GetIsolate()->fac
Sven Panne
2012/02/09 08:17:48
Good point. Done.
|
+ } |
+ Handle<String> source(String::cast(Script::cast(script())->source())); |
+ return SubString(source, start_position(), end_position()); |
} |