From a93fd66157bbffb6b09f839d9c37824cc19e278f Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 29 Oct 2014 14:00:57 -0700 Subject: [PATCH] Fix line numbers in JavaScript stack traces Instead of calling the function constructor to compile script in Sky, we now concatenate strings. This has the advantage of making the line numbers generated in error messages correct but the disadvantage of being a hack. I've filed https://code.google.com/p/v8/issues/detail?id=3624 to request a proper API for this purpose. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/688033003 --- .../mutation-observer/mutation-record-nullity.sky | 4 ++-- .../tests/mutation-observer/observe-subtree.sky | 3 +++ .../src/flutter/tests/parser/script-expected.txt | 14 +++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/engine/src/flutter/tests/mutation-observer/mutation-record-nullity.sky b/engine/src/flutter/tests/mutation-observer/mutation-record-nullity.sky index da198ef6c9..93a751b013 100644 --- a/engine/src/flutter/tests/mutation-observer/mutation-record-nullity.sky +++ b/engine/src/flutter/tests/mutation-observer/mutation-record-nullity.sky @@ -22,7 +22,7 @@ describe('Non-relevant properties on mutation records should be null, except for var div = document.createElement('div'); observer.observe(div, {childList: true}); div.appendChild(document.createElement('span')); - record = observer.takeRecords()[0]; + var record = observer.takeRecords()[0]; assert.isNull(record.attributeName); assert.isNull(record.oldValue); }); @@ -30,7 +30,7 @@ describe('Non-relevant properties on mutation records should be null, except for var div = document.createElement('div'); observer.observe(div, {attributes: true}); div.setAttribute('data-foo', 'bar'); - record = observer.takeRecords()[0]; + var record = observer.takeRecords()[0]; assert.isNull(record.oldValue); assert.isNull(record.previousSibling); assert.isNull(record.nextSibling); diff --git a/engine/src/flutter/tests/mutation-observer/observe-subtree.sky b/engine/src/flutter/tests/mutation-observer/observe-subtree.sky index 075c11b2d8..8840532f79 100644 --- a/engine/src/flutter/tests/mutation-observer/observe-subtree.sky +++ b/engine/src/flutter/tests/mutation-observer/observe-subtree.sky @@ -195,8 +195,11 @@ describe('MutationObserver.observe on a subtree', function() { it('should have correct behavior of transient observation with complex movement', function(done) { var observer; + var text; var subDiv; var mutations; + var subDiv2; + var subDiv3; function start() { var div = document.createElement('div'); diff --git a/engine/src/flutter/tests/parser/script-expected.txt b/engine/src/flutter/tests/parser/script-expected.txt index 8bbdefd4f5..76e4aae64b 100644 --- a/engine/src/flutter/tests/parser/script-expected.txt +++ b/engine/src/flutter/tests/parser/script-expected.txt @@ -1,17 +1,17 @@ ERROR: Uncaught SyntaxError: Unexpected token < -SOURCE: http://127.0.0.1:8000/parser/script.sky:3 +SOURCE: http://127.0.0.1:8000/parser/script.sky:6 ERROR: Uncaught SyntaxError: Unexpected token < -SOURCE: http://127.0.0.1:8000/parser/script.sky:3 +SOURCE: http://127.0.0.1:8000/parser/script.sky:14 ERROR: Uncaught SyntaxError: Unexpected token < -SOURCE: http://127.0.0.1:8000/parser/script.sky:3 +SOURCE: http://127.0.0.1:8000/parser/script.sky:21 ERROR: Uncaught ReferenceError: TEST is not defined -SOURCE: http://127.0.0.1:8000/parser/script.sky:2 +SOURCE: http://127.0.0.1:8000/parser/script.sky:27 ERROR: Uncaught SyntaxError: Invalid regular expression: missing / -SOURCE: http://127.0.0.1:8000/parser/script.sky:2 +SOURCE: http://127.0.0.1:8000/parser/script.sky:34 ERROR: Uncaught SyntaxError: Invalid regular expression: missing / -SOURCE: http://127.0.0.1:8000/parser/script.sky:2 +SOURCE: http://127.0.0.1:8000/parser/script.sky:38 ERROR: Uncaught SyntaxError: Unexpected token } -SOURCE: http://127.0.0.1:8000/parser/script.sky:4 +SOURCE: http://127.0.0.1:8000/parser/script.sky:43