Web Inspector: Wrong column numbers in error object views
authornvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 4 Oct 2015 18:33:21 +0000 (18:33 +0000)
committernvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 4 Oct 2015 18:33:21 +0000 (18:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149795

Source/WebInspectorUI:

Convert columnNumber and lineNumber properties from strings to numbers
to prevent accidental string concatenations.

Reviewed by Timothy Hatcher.

* UserInterface/Models/StackTrace.js:
(WebInspector.StackTrace._parseStackTrace):

LayoutTests:

Reviewed by Timothy Hatcher.

* inspector/debugger/js-stacktrace-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/inspector/debugger/js-stacktrace-expected.txt
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/StackTrace.js

index f4b2b2c..cc22706 100644 (file)
@@ -1,3 +1,12 @@
+2015-10-04  Nikita Vasilyev  <nvasilyev@apple.com>
+
+        Web Inspector: Wrong column numbers in error object views
+        https://bugs.webkit.org/show_bug.cgi?id=149795
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/debugger/js-stacktrace-expected.txt:
+
 2015-10-03  Alexey Proskuryakov  <ap@apple.com>
 
         fast/events/overflow-scroll-fake-mouse-move.html is flaky
index ad6894e..0c97e90 100644 (file)
@@ -21,14 +21,14 @@ Error object:
     {
         "functionName": "typeError",
         "url": "/inspector/debugger/js-stacktrace.html",
-        "lineNumber": "14",
-        "columnNumber": "30"
+        "lineNumber": 14,
+        "columnNumber": 30
     },
     {
         "functionName": "typeErrorWrap",
         "url": "/inspector/debugger/js-stacktrace.html",
-        "lineNumber": "7",
-        "columnNumber": "21"
+        "lineNumber": 7,
+        "columnNumber": 21
     }
 ]
 
@@ -59,8 +59,8 @@ Error object:
     {
         "functionName": "typeError",
         "url": "/inspector/debugger/js-stacktrace.html",
-        "lineNumber": "14",
-        "columnNumber": "30"
+        "lineNumber": 14,
+        "columnNumber": 30
     },
     {
         "functionName": "map",
index e1c1161..551e4ea 100644 (file)
@@ -1,3 +1,16 @@
+2015-10-04  Nikita Vasilyev  <nvasilyev@apple.com>
+
+        Web Inspector: Wrong column numbers in error object views
+        https://bugs.webkit.org/show_bug.cgi?id=149795
+
+        Convert columnNumber and lineNumber properties from strings to numbers
+        to prevent accidental string concatenations.
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Models/StackTrace.js:
+        (WebInspector.StackTrace._parseStackTrace):
+
 2015-10-02  Matt Baker  <mattbaker@apple.com>
 
         Web Inspector: Add breakpoint option to ignore n times before stopping
index af69e7b..d4c645b 100644 (file)
@@ -66,12 +66,12 @@ WebInspector.StackTrace = class StackTrace extends WebInspector.Object
 
                 var columnIndex = url.lastIndexOf(":");
                 if (columnIndex !== -1) {
-                    columnNumber = url.slice(columnIndex + 1);
+                    columnNumber = parseInt(url.slice(columnIndex + 1));
 
                     url = url.slice(0, columnIndex);
                     var lineIndex = url.lastIndexOf(":", columnIndex);
                     if (lineIndex !== -1) {
-                        lineNumber = url.slice(lineIndex + 1, columnIndex);
+                        lineNumber = parseInt(url.slice(lineIndex + 1, columnIndex));
                         url = url.slice(0, lineIndex);
                     }
                 }