Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index e4f165ae44e5e64051c8ea176e5687b6869ef11b..7d72466c4731e30a51aa0e13c4303c96978d6835 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -7615,13 +7615,10 @@ 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 GetIsolate()->factory()->undefined_value(); |
+ Handle<String> source(String::cast(Script::cast(script())->source())); |
+ return SubString(source, start_position(), end_position()); |
} |