functionProtoFuncToString should not rely on typeProfilingEndOffset()
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Sep 2015 01:21:47 +0000 (01:21 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Sep 2015 01:21:47 +0000 (01:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149429

Reviewed by Geoffrey Garen.

We should be able to freely change typeProfilingEndOffset()
without worrying we will break Function.prototype.toString.

* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190096 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/FunctionPrototype.cpp

index 354aa91..19f1b6e 100644 (file)
@@ -1,3 +1,16 @@
+2015-09-21  Saam barati  <sbarati@apple.com>
+
+        functionProtoFuncToString should not rely on typeProfilingEndOffset()
+        https://bugs.webkit.org/show_bug.cgi?id=149429
+
+        Reviewed by Geoffrey Garen.
+
+        We should be able to freely change typeProfilingEndOffset()
+        without worrying we will break Function.prototype.toString.
+
+        * runtime/FunctionPrototype.cpp:
+        (JSC::functionProtoFuncToString):
+
 2015-09-21  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r190086.
index 6b3a094..970d012 100644 (file)
@@ -93,7 +93,7 @@ EncodedJSValue JSC_HOST_CALL functionProtoFuncToString(ExecState* exec)
         
         String source = executable->source().provider()->getRange(
             executable->parametersStartOffset(),
-            executable->typeProfilingEndOffset() + 1); // Type profiling end offset is the character before the '}'.
+            executable->parametersStartOffset() + executable->source().length());
         return JSValue::encode(jsMakeNontrivialString(exec, functionHeader, function->name(exec), source));
     }