New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Improve error messages

Project Member Reported by gsat...@chromium.org, Jun 21 2017

Issue description

Tracking issue to brainstorm ideas on improving errors messages in V8
 
Components: Language
Labels: Priority-2
Labels: -Type-Bug Type-FeatureRequest
Cc: littledan@chromium.org
One idea that could be to link against MDN for non obvious errors similar to Firefox, but I'm concerned about the maintenance overhead.

What are some other things about error messages that could be improved? Are there any specific examples?
Blockedon: 6142 6499 5532
Blockedon: 6233 5607 5325 3698
When I suggested adding links for non-obvious errors, I didn’t necessarily have MDN in mind. Ideally it would be a document under our control (since our error-messages are V8-specific), shortened into a goo.gl URL.

I was thinking of something like https://github.com/vhf/v8-bailout-reasons, e.g. https://github.com/vhf/v8-bailout-reasons#assignment-to-parameter-in-arguments-object. This could live on the V8 wiki itself, or it could be a separate repository so we could more easily accept community contributions.
Blockedon: 6522
Blockedon: 6551
Blockedon: 4252
https://twitter.com/subzey/status/882178041073610752

    var c = Function.prototype.call; c();
    // Uncaught TypeError: c is not a function

Should be something like:

    c is called with undefined as a context which is not a function
Project Member

Comment 11 by bugdroid1@chromium.org, Jul 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/d8e1c4840c68da509d00099741f70445f33fa502

commit d8e1c4840c68da509d00099741f70445f33fa502
Author: Sathya Gunasekaran <gsathya@chromium.org>
Date: Thu Jul 06 19:57:44 2017

[parser] Improve error message for destructuring non iterable

Print the object that is being destructured and update the error 
message.

Previously,
  d8> var [a] = {}
  (d8):1: TypeError: [Symbol.iterator] is not a function

Now,
  d8> var [a] = {}
  (d8):1: TypeError: {} is not iterable

Bug: v8:6513, v8:5532
Change-Id: I5cbfe7c7e20632bce1a48bd38a1b0c98d0ff0660
Reviewed-on: https://chromium-review.googlesource.com/557370
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#46457}
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/src/ast/ast.h
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/src/ast/prettyprinter.cc
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/src/ast/prettyprinter.h
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/src/messages.h
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/src/parsing/pattern-rewriter.cc
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/src/runtime/runtime-internal.cc
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/cctest/interpreter/bytecode_expectations/ForOf.golden
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/cctest/interpreter/bytecode_expectations/Generators.golden
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/message/destructuring-array-non-iterable-number.out
[add] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/message/destructuring-array-non-iterable-object-literal-complex.js
[add] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/message/destructuring-array-non-iterable-object-literal-complex.out
[add] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/message/destructuring-array-non-iterable-object-literal.js
[add] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/message/destructuring-array-non-iterable-object-literal.out
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/message/destructuring-array-non-iterable-object.out
[add] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/message/for-of-non-iterable.js
[add] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/message/for-of-non-iterable.out
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/message/get-iterator1.out
[add] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/mjsunit/harmony/async-for-of-non-iterable.js
[modify] https://crrev.com/d8e1c4840c68da509d00099741f70445f33fa502/test/webkit/exception-for-nonobject-expected.txt

Project Member

Comment 12 by bugdroid1@chromium.org, Jul 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/755d09e671f370a99fe908443f77104a4a08d4e5

commit 755d09e671f370a99fe908443f77104a4a08d4e5
Author: Sathya Gunasekaran <gsathya@chromium.org>
Date: Fri Jul 14 00:10:06 2017

[parser] Update {Binding,Assignment}RestPattern

Only allow BindingIdentifier in BindingRestPattern and 
ValidReferenceExpression in AssignmentRestPattern.

Also updated to a better, actionable error message.

Bug:  v8:6500 , v8:6513
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Ifaba2f85c20bc20e263267e8c76d50a27075b87d
Reviewed-on: https://chromium-review.googlesource.com/550559
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46653}
[modify] https://crrev.com/755d09e671f370a99fe908443f77104a4a08d4e5/src/messages.h
[modify] https://crrev.com/755d09e671f370a99fe908443f77104a4a08d4e5/src/parsing/parser-base.h
[modify] https://crrev.com/755d09e671f370a99fe908443f77104a4a08d4e5/test/cctest/test-parsing.cc
[add] https://crrev.com/755d09e671f370a99fe908443f77104a4a08d4e5/test/message/object-rest-assignment-pattern.js
[add] https://crrev.com/755d09e671f370a99fe908443f77104a4a08d4e5/test/message/object-rest-assignment-pattern.out
[add] https://crrev.com/755d09e671f370a99fe908443f77104a4a08d4e5/test/message/object-rest-binding-pattern.js
[add] https://crrev.com/755d09e671f370a99fe908443f77104a4a08d4e5/test/message/object-rest-binding-pattern.out
[modify] https://crrev.com/755d09e671f370a99fe908443f77104a4a08d4e5/test/mjsunit/harmony/object-rest-basic.js
[modify] https://crrev.com/755d09e671f370a99fe908443f77104a4a08d4e5/test/test262/test262.status

Blockedon: 6598
Blockedon: 6599
Project Member

Comment 15 by bugdroid1@chromium.org, Jul 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/94ce16b7047dfea907aac64fbea74c843ce40ea8

commit 94ce16b7047dfea907aac64fbea74c843ce40ea8
Author: Sathya Gunasekaran <gsathya@chromium.org>
Date: Mon Jul 17 22:18:19 2017

Fix error message while array destructuring undefined

Previously,
  ➜  v8 (master) ✔ ./out.gn/x64.optdebug/d8
  V8 version 6.1.0 (candidate)
  d8> var x = undefined
  undefined
  d8> var [a] = x
  (d8):1: TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
  var [a] = x
            ^
  TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
      at (d8):1:11

Now,
  ➜  v8 (fix-iterator) ✔ ./out.gn/x64.optdebug/d8
  V8 version 6.1.0 (candidate)
  d8> var x = undefined
  undefined
  d8> var [a] = x
  (d8):1: TypeError: x is not iterable
  var [a] = x
            ^
  TypeError: x is not iterable
      at (d8):1:11


Bug:  v8:6599 , v8:6513
Change-Id: I71287a19166af0289e8f7708b8f41ad003ae87ae
Reviewed-on: https://chromium-review.googlesource.com/571175
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46723}
[modify] https://crrev.com/94ce16b7047dfea907aac64fbea74c843ce40ea8/src/ic/ic.cc
[modify] https://crrev.com/94ce16b7047dfea907aac64fbea74c843ce40ea8/src/runtime/runtime-internal.cc
[modify] https://crrev.com/94ce16b7047dfea907aac64fbea74c843ce40ea8/src/runtime/runtime.h
[add] https://crrev.com/94ce16b7047dfea907aac64fbea74c843ce40ea8/test/message/destructuring-array-non-iterable-undefined.js
[add] https://crrev.com/94ce16b7047dfea907aac64fbea74c843ce40ea8/test/message/destructuring-array-non-iterable-undefined.out

Blockedon: 6616
Project Member

Comment 17 by bugdroid1@chromium.org, Jul 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/62a7c080d5348bf35a9e1dd3a84449bc51d154b1

commit 62a7c080d5348bf35a9e1dd3a84449bc51d154b1
Author: Sathya Gunasekaran <gsathya@chromium.org>
Date: Tue Jul 25 22:53:58 2017

[parser] Provide better error when incorrectly using await

Before we try to do ASI and fail with a generic error, we special case
for the await token in the failure case.

Bug:  v8:6572 , v8:6513
Change-Id: Ia050c98b5a5b20bc326f429a367635b8553e4112
Reviewed-on: https://chromium-review.googlesource.com/582210
Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46885}
[modify] https://crrev.com/62a7c080d5348bf35a9e1dd3a84449bc51d154b1/src/messages.h
[modify] https://crrev.com/62a7c080d5348bf35a9e1dd3a84449bc51d154b1/src/parsing/parser-base.h
[modify] https://crrev.com/62a7c080d5348bf35a9e1dd3a84449bc51d154b1/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden
[modify] https://crrev.com/62a7c080d5348bf35a9e1dd3a84449bc51d154b1/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden
[modify] https://crrev.com/62a7c080d5348bf35a9e1dd3a84449bc51d154b1/test/cctest/interpreter/bytecode_expectations/ForOf.golden
[modify] https://crrev.com/62a7c080d5348bf35a9e1dd3a84449bc51d154b1/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden
[modify] https://crrev.com/62a7c080d5348bf35a9e1dd3a84449bc51d154b1/test/cctest/interpreter/bytecode_expectations/Generators.golden
[modify] https://crrev.com/62a7c080d5348bf35a9e1dd3a84449bc51d154b1/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden
[add] https://crrev.com/62a7c080d5348bf35a9e1dd3a84449bc51d154b1/test/message/await-non-async.js
[add] https://crrev.com/62a7c080d5348bf35a9e1dd3a84449bc51d154b1/test/message/await-non-async.out
[modify] https://crrev.com/62a7c080d5348bf35a9e1dd3a84449bc51d154b1/test/mjsunit/es8/async-await-basic.js

Blockedon: 6645
Project Member

Comment 19 by bugdroid1@chromium.org, Aug 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/c805d5e317e5202e1b9f75b882a2a14cfff38698

commit c805d5e317e5202e1b9f75b882a2a14cfff38698
Author: Sathya Gunasekaran <gsathya@chromium.org>
Date: Tue Aug 01 01:19:08 2017

[parser] Provide better error when destructuring callable

The patch changes CallPrinter's AST traversal to continue even after
the first positive match for an AST node. This helps us check for the
subsequent GetIterator AST node in case of destructuring.

We can not differentiate between the function call failing and the
GetIterator failing based on source position info. This would involve
runtime checks costing performance.

Instead of providing an incorrect error, we provide both the
possiblities to user and allow them to disambiguate.

Previously,
  d8> function f() { return 5; }
  undefined
  d8> var [a] = f();
  (d8):1: TypeError: f is not a function
  var [a] = f();
            ^
  TypeError: f is not a function
      at (d8):1:11


Now,
  d8> function f() { return 5; }
  undefined
  d8> var [a] = f();
  (d8):1: TypeError: f is not a function or its return value is not iterable
  var [a] = f();
            ^
  TypeError: f is not a function or its return value is not iterable
      at (d8):1:11

Bug:  v8:6616 , v8:6513
Change-Id: I3d6427f10cae54951b0ad0e5ddcbe802bb7191c1
Reviewed-on: https://chromium-review.googlesource.com/594894
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47025}
[modify] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/src/ast/prettyprinter.cc
[modify] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/src/ast/prettyprinter.h
[modify] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/src/messages.h
[modify] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/src/runtime/runtime-internal.cc
[modify] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden
[modify] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden
[modify] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/cctest/interpreter/bytecode_expectations/ForOf.golden
[modify] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden
[modify] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/cctest/interpreter/bytecode_expectations/Generators.golden
[add] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/message/destructuring-function-non-iterable.js
[add] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/message/destructuring-function-non-iterable.out
[add] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/message/destructuring-new-callable-non-iterable.js
[add] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/message/destructuring-new-callable-non-iterable.out
[add] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/message/destructuring-non-function-non-iterable.js
[add] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/message/destructuring-non-function-non-iterable.out
[modify] https://crrev.com/c805d5e317e5202e1b9f75b882a2a14cfff38698/test/message/get-iterator1.out

Blockedon: chromium:599850
Blockedon: 6839
Cc: kozyatinskiy@chromium.org
 Issue chromium:763713  has been merged into this issue.
Blockedon: 6894
Blockedon: 7013
Project Member

Comment 25 by bugdroid1@chromium.org, Oct 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/c3458a86722d735ef4c4e31f9bcaa966e5093e47

commit c3458a86722d735ef4c4e31f9bcaa966e5093e47
Author: Sathya Gunasekaran <gsathya@chromium.org>
Date: Mon Oct 30 20:04:38 2017

[parser] Add new FunctionNameInferrer state before parsing param

Create new state before parsing FormalParameter because we don't
want to use any of the parameters as an inferred function name.

Previously the stacktrace was:
  test.js:3: Error: boom
      throw new Error('boom');
      ^
  Error: boom
      at param (test.js:3:11)
      at test.js:4:5
      at test.js:6:3

The stacktrace with this patch:
  test.js:3: Error: boom
      throw new Error('boom');
      ^
  Error: boom
      at test.js:3:11
      at test.js:4:5
      at test.js:6:3


Bug:  v8:6822 , v8:6513
Change-Id: Ifbadc660fc4e85248af405acd67c025f11662bd4
Reviewed-on: https://chromium-review.googlesource.com/742657
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49042}
[modify] https://crrev.com/c3458a86722d735ef4c4e31f9bcaa966e5093e47/src/parsing/parser-base.h
[add] https://crrev.com/c3458a86722d735ef4c4e31f9bcaa966e5093e47/test/message/fail/func-name-inferrer-arg-1.js
[add] https://crrev.com/c3458a86722d735ef4c4e31f9bcaa966e5093e47/test/message/fail/func-name-inferrer-arg-1.out
[add] https://crrev.com/c3458a86722d735ef4c4e31f9bcaa966e5093e47/test/message/fail/func-name-inferrer-arg.js
[add] https://crrev.com/c3458a86722d735ef4c4e31f9bcaa966e5093e47/test/message/fail/func-name-inferrer-arg.out

Blockedon: 6973
Blockedon: 6822
Blockedon: 6572
Blockedon: 7020
Project Member

Comment 30 by bugdroid1@chromium.org, Oct 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/dbcea11564cfc76da719846e526f254ef1d71e91

commit dbcea11564cfc76da719846e526f254ef1d71e91
Author: Mathias Bynens <mathias@chromium.org>
Date: Tue Oct 31 19:42:44 2017

[parser] Improve error message for `import()`

Currently, dynamic `import()` throws the following SyntaxError when
used without a specifier:

    > import();
    < Uncaught SyntaxError: Unexpected token )

From the error message, it seems this the result of the code snippet
being seen as static `import` followed by parens, as opposed to
`import()` with no specifier.

This patch makes this error message more clear:

    > import();
    < SyntaxError: import() requires a specifier

BUG= v8:7020 ,v8:6513

Change-Id: I3519dfd0029f38d23da858a5499f1d226e794935
Reviewed-on: https://chromium-review.googlesource.com/747141
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49058}
[modify] https://crrev.com/dbcea11564cfc76da719846e526f254ef1d71e91/src/messages.h
[modify] https://crrev.com/dbcea11564cfc76da719846e526f254ef1d71e91/src/parsing/parser-base.h
[modify] https://crrev.com/dbcea11564cfc76da719846e526f254ef1d71e91/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden
[modify] https://crrev.com/dbcea11564cfc76da719846e526f254ef1d71e91/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden
[modify] https://crrev.com/dbcea11564cfc76da719846e526f254ef1d71e91/test/cctest/interpreter/bytecode_expectations/ForOf.golden
[modify] https://crrev.com/dbcea11564cfc76da719846e526f254ef1d71e91/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden
[modify] https://crrev.com/dbcea11564cfc76da719846e526f254ef1d71e91/test/cctest/interpreter/bytecode_expectations/Generators.golden
[modify] https://crrev.com/dbcea11564cfc76da719846e526f254ef1d71e91/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden
[add] https://crrev.com/dbcea11564cfc76da719846e526f254ef1d71e91/test/message/fail/dynamic-import-missing-specifier.js
[add] https://crrev.com/dbcea11564cfc76da719846e526f254ef1d71e91/test/message/fail/dynamic-import-missing-specifier.out

Comment 31 by adamk@chromium.org, Oct 31 2017

Blockedon: chromium:779733

Comment 32 by adamk@chromium.org, Oct 31 2017

Blockedon: 7021
Blockedon: 5957
Blockedon: 6951
Blockedon: chromium:789660
Blockedon: 7197

Comment 37 by adamk@chromium.org, Dec 11 2017

Blockedon: 7154

Comment 38 by adamk@chromium.org, Feb 13 2018

Blockedon: chromium:808406
Blockedon: 7502
Blockedon: 7507
Blockedon: 7968
Blockedon: 8144
Project Member

Comment 43 by bugdroid1@chromium.org, Oct 17

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/e1c6fa88789988ad2c623a3c4104fa826b84ad13

commit e1c6fa88789988ad2c623a3c4104fa826b84ad13
Author: Toon Verwaest <verwaest@chromium.org>
Date: Wed Oct 17 10:21:44 2018

[parser] Token-range-check for callable identifier tokens

This also fixes the tokens that are identified as called identifiers.

Change-Id: I4a2179b98214f9018c8c07c0ab27f878cdae13cf
Bug: v8:6513
Reviewed-on: https://chromium-review.googlesource.com/c/1286338
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56719}
[modify] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/src/parsing/parser-base.h
[modify] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/src/parsing/token.h
[modify] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/test/cctest/test-parsing.cc
[add] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/test/message/fail/call-async.js
[add] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/test/message/fail/call-async.out
[add] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/test/message/fail/call-await.js
[add] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/test/message/fail/call-await.out
[add] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/test/message/fail/call-let.js
[add] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/test/message/fail/call-let.out
[add] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/test/message/fail/call-static.js
[add] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/test/message/fail/call-static.out
[add] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/test/message/fail/call-yield.js
[add] https://crrev.com/e1c6fa88789988ad2c623a3c4104fa826b84ad13/test/message/fail/call-yield.out

Blockedon: 8340
Blockedon: 3659
Project Member

Comment 46 by bugdroid1@chromium.org, Dec 10

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8

commit 92db073fcebc04c4ccfb2ab8618af4b5f8de70f8
Author: Mathias Bynens <mathias@chromium.org>
Date: Mon Dec 10 08:15:57 2018

[parser] Improve error message for unclosed function bodies

This patch changes the output from:

  function fn() {
                ^
  SyntaxError: Unexpected end of input

to:

  function fn() {
                ^
  SyntaxError: missing '}' after function body

Bug: v8:6513, v8:7321
Change-Id: I4ca8a40fa0be246da2a3ff776b3fb3c87b4ba4e0
Also-By: gsathya@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/1367448
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58116}
[modify] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/src/message-template.h
[modify] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/src/parsing/parser-base.h
[modify] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden
[modify] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden
[modify] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/cctest/interpreter/bytecode_expectations/ForOf.golden
[modify] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden
[modify] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/cctest/interpreter/bytecode_expectations/Generators.golden
[modify] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-brace-after-arrow-function.js
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-brace-after-arrow-function.out
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-brace-after-function-body.js
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-brace-after-function-body.out
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-brace-after-if.js
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-brace-after-if.out
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-brace-after-object-literal.js
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-brace-after-object-literal.out
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-paren-after-if-condition.js
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-paren-after-if-condition.out
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-paren-after-iife.js
[add] https://crrev.com/92db073fcebc04c4ccfb2ab8618af4b5f8de70f8/test/message/fail/missing-paren-after-iife.out

Project Member

Comment 47 by bugdroid1@chromium.org, Dec 10

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/5e8301fd250aa2ac3428f8649b2d075669db0c9a

commit 5e8301fd250aa2ac3428f8649b2d075669db0c9a
Author: Leszek Swirski <leszeks@chromium.org>
Date: Mon Dec 10 13:09:07 2018

Revert "[parser] Improve error message for unclosed function bodies"

This reverts commit 92db073fcebc04c4ccfb2ab8618af4b5f8de70f8.

Reason for revert: Breaks devtools test https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Win/15539

Devtools seems to parse our error messages, e.g. https://cs.chromium.org/chromium/src/third_party/blink/renderer/devtools/front_end/object_ui/JavaScriptAutocomplete.js?type=cs&q=isExpressionComplete+javascriptautocomplete&sq=package:chromium&g=0&l=612

Original change's description:
> [parser] Improve error message for unclosed function bodies
> 
> This patch changes the output from:
> 
>   function fn() {
>                 ^
>   SyntaxError: Unexpected end of input
> 
> to:
> 
>   function fn() {
>                 ^
>   SyntaxError: missing '}' after function body
> 
> Bug: v8:6513, v8:7321
> Change-Id: I4ca8a40fa0be246da2a3ff776b3fb3c87b4ba4e0
> Also-By: gsathya@chromium.org
> Reviewed-on: https://chromium-review.googlesource.com/c/1367448
> Commit-Queue: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58116}

TBR=marja@chromium.org,gsathya@chromium.org,mathias@chromium.org

Change-Id: Ia2ac413d67fda39eda903c056002ae632df73df9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6513, v8:7321
Reviewed-on: https://chromium-review.googlesource.com/c/1370026
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58124}
[modify] https://crrev.com/5e8301fd250aa2ac3428f8649b2d075669db0c9a/src/message-template.h
[modify] https://crrev.com/5e8301fd250aa2ac3428f8649b2d075669db0c9a/src/parsing/parser-base.h
[modify] https://crrev.com/5e8301fd250aa2ac3428f8649b2d075669db0c9a/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden
[modify] https://crrev.com/5e8301fd250aa2ac3428f8649b2d075669db0c9a/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden
[modify] https://crrev.com/5e8301fd250aa2ac3428f8649b2d075669db0c9a/test/cctest/interpreter/bytecode_expectations/ForOf.golden
[modify] https://crrev.com/5e8301fd250aa2ac3428f8649b2d075669db0c9a/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden
[modify] https://crrev.com/5e8301fd250aa2ac3428f8649b2d075669db0c9a/test/cctest/interpreter/bytecode_expectations/Generators.golden
[modify] https://crrev.com/5e8301fd250aa2ac3428f8649b2d075669db0c9a/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-brace-after-arrow-function.js
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-brace-after-arrow-function.out
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-brace-after-function-body.js
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-brace-after-function-body.out
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-brace-after-if.js
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-brace-after-if.out
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-brace-after-object-literal.js
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-brace-after-object-literal.out
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-paren-after-if-condition.js
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-paren-after-if-condition.out
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-paren-after-iife.js
[delete] https://crrev.com/6663ed49dc7988b4b918f4e0bfc26a0d224e4d6e/test/message/fail/missing-paren-after-iife.out

Blockedon: 8578
Blockedon: 8695

Comment 50 by szuend@chromium.org, Jan 18 (5 days ago)

Blockedon: 8696
Project Member

Comment 51 by bugdroid, Today (9 hours ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/d6779b25227c82cd9c2e3e69c9edf8697036ed80

commit d6779b25227c82cd9c2e3e69c9edf8697036ed80
Author: Simon Zünd <szuend@chromium.org>
Date: Wed Jan 23 08:30:19 2019

[json] Replace JSArray with std::vector to track circular structures

This CL prepares JSON#stringify for improved error messages when
serializing circular structures. To this end, we also push the
key/index, in addition to the object itself, onto the stack that keeps
track of circular structures.

The stack itself is changed from a JSArray to a std::vector.

R=yangguo@chromium.org

Bug: v8:6513, v8:8698
Change-Id: I6dc4cb3be75a4514281411c654337f37c8798e55
Reviewed-on: https://chromium-review.googlesource.com/c/1424863
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59019}
[modify] https://crrev.com/d6779b25227c82cd9c2e3e69c9edf8697036ed80/src/json-stringifier.cc

Project Member

Comment 52 by bugdroid, Today (9 hours ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/d6779b25227c82cd9c2e3e69c9edf8697036ed80

commit d6779b25227c82cd9c2e3e69c9edf8697036ed80
Author: Simon Zünd <szuend@chromium.org>
Date: Wed Jan 23 08:30:19 2019

[json] Replace JSArray with std::vector to track circular structures

This CL prepares JSON#stringify for improved error messages when
serializing circular structures. To this end, we also push the
key/index, in addition to the object itself, onto the stack that keeps
track of circular structures.

The stack itself is changed from a JSArray to a std::vector.

R=yangguo@chromium.org

Bug: v8:6513, v8:8698
Change-Id: I6dc4cb3be75a4514281411c654337f37c8798e55
Reviewed-on: https://chromium-review.googlesource.com/c/1424863
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59019}
[modify] https://crrev.com/d6779b25227c82cd9c2e3e69c9edf8697036ed80/src/json-stringifier.cc

Sign in to add a comment