v8/test/cctest/interpreter/bytecode_expectations
Sathya Gunasekaran bc2c785c20 [parser] Better error message when destructuring against undefined/null
Previously, when destructuring against null or undefined we would
print:

  d8> var { x } = null
  (d8):1: TypeError: Cannot match against 'undefined' or 'null'.
  var { x } = null
  ^
  TypeError: Cannot match against 'undefined' or 'null'.
      at (d8):1:1


The above message uses the term "match" which isn't a common term in
JavaScript to describe destructuring. This message also doesn't
provide the name of the property that fails destructuring.

This patch changes the error message to be:

  d8> var { x } = null;
  (d8):1: TypeError: Cannot destructure property `x` of 'undefined' or 'null'.
  var { x } = null;
        ^
  TypeError: Cannot destructure property `x` of 'undefined' or 'null'.
      at (d8):1:1

This patch changes the message to say "destructure" instead of "match".

This patch adds support for printing property names that are string
literals. We iterate through every property and pick the first string
literal property name if it exists. This provides at least some
feedback to the developer.

This patch also makes the pointer point to the position of the
property name that fails destructuring.

For computed and numeric property names, we print a generic error:
  d8> var { 1: x } = null
  (d8):1: TypeError: Cannot destructure against 'undefined' or 'null'.
  var { 1: x } = null
  ^
  TypeError: Cannot destructure against 'undefined' or 'null'.
      at (d8):1:1

Bug: v8:6499
Change-Id: I35b1ac749489828686f042975294b9926e2dfc53
Reviewed-on: https://chromium-review.googlesource.com/537341
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45965}
2017-06-15 21:52:58 +00:00
..
ArrayLiterals.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
ArrayLiteralsWide.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
AssignmentsInBinaryExpression.golden [inspector] moved var initialization break location before init expression (reland) 2017-05-30 12:54:49 +00:00
BasicBlockToBoolean.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
BasicLoops.golden [interpreter] Avoid redundant {PopContext} instructions. 2017-05-24 11:58:47 +00:00
BreakableBlocks.golden [ignition] Fix register flushing performance issue 2017-06-09 09:58:15 +00:00
CallAndSpread.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
CallGlobal.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
CallLookupSlot.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
CallNew.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
CallRuntime.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
ClassAndSuperClass.golden [ignition] Fix register flushing performance issue 2017-06-09 09:58:15 +00:00
ClassDeclarations.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
CompareNil.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
CompareTypeOf.golden [Interpreter] Optimize code of the form 'if (x === undefined)'. 2017-04-03 14:17:16 +00:00
CompoundExpressions.golden [runtime] Directly support double values in CloneShallowObjectLiteral 2017-05-29 13:27:17 +00:00
Conditional.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
ConstVariable.golden [Interpreter] Introduce bytecodes that check for hole and throw. 2017-06-06 09:41:31 +00:00
ConstVariableContextSlot.golden [Interpreter] Introduce bytecodes that check for hole and throw. 2017-06-06 09:41:31 +00:00
ContextParameters.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
ContextVariables.golden [interpreter] Avoid redundant {PopContext} instructions. 2017-05-24 11:58:47 +00:00
CountOperators.golden [runtime] Directly support double values in CloneShallowObjectLiteral 2017-05-29 13:27:17 +00:00
CreateArguments.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
CreateRestParameter.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
DeadCodeRemoval.golden [ignition] Expect 'I' for signed bytecode operands 2017-01-25 17:39:24 +00:00
DeclareGlobals.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
Delete.golden [runtime] Directly support double values in CloneShallowObjectLiteral 2017-05-29 13:27:17 +00:00
DeleteLookupSlotInEval.golden [interpreter] Remove redundant flag from bytecode cctest suite. 2016-10-04 16:30:15 +00:00
DoDebugger.golden [interpreter] Remove redundant flag from bytecode cctest suite. 2016-10-04 16:30:15 +00:00
DoExpression.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
Eval.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
ForAwaitOf.golden [parser] Better error message when destructuring against undefined/null 2017-06-15 21:52:58 +00:00
ForIn.golden [runtime] Directly support double values in CloneShallowObjectLiteral 2017-05-29 13:27:17 +00:00
ForOf.golden [parser] Better error message when destructuring against undefined/null 2017-06-15 21:52:58 +00:00
ForOfLoop.golden [parser] Better error message when destructuring against undefined/null 2017-06-15 21:52:58 +00:00
FunctionLiterals.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
GenerateTestUndetectable.golden [runtime] Directly support double values in CloneShallowObjectLiteral 2017-05-29 13:27:17 +00:00
Generators.golden [parser] Better error message when destructuring against undefined/null 2017-06-15 21:52:58 +00:00
GlobalCompoundExpressions.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
GlobalCountOperators.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
GlobalDelete.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
HeapNumberConstants.golden [interpreter] Remove redundant flag from bytecode cctest suite. 2016-10-04 16:30:15 +00:00
IfConditions.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
IntegerConstants.golden [ignition] Expect 'I' for signed bytecode operands 2017-01-25 17:39:24 +00:00
JumpsRequiringConstantWideOperands.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
LetVariable.golden [Interpreter] Introduce bytecodes that check for hole and throw. 2017-06-06 09:41:31 +00:00
LetVariableContextSlot.golden [Interpreter] Introduce bytecodes that check for hole and throw. 2017-06-06 09:41:31 +00:00
LoadGlobal.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
LogicalExpressions.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
LookupSlot.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
LookupSlotInEval.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
LookupSlotWideInEval.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
Modules.golden Move closing of generators upon final return to the generator-resume builtin. 2017-06-13 13:49:45 +00:00
NewAndSpread.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
NewTarget.golden [ignition] Fix register flushing performance issue 2017-06-09 09:58:15 +00:00
ObjectLiterals.golden [interpreter] Make sure allocated registers are always materialized in the register optimizer. 2017-06-07 15:39:56 +00:00
ObjectLiteralsWide.golden [runtime] Directly support double values in CloneShallowObjectLiteral 2017-05-29 13:27:17 +00:00
OuterContextVariables.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
Parameters.golden [ignition] Expect 'I' for signed bytecode operands 2017-01-25 17:39:24 +00:00
PrimitiveExpressions.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
PrimitiveReturnStatements.golden [ignition] Expect 'I' for signed bytecode operands 2017-01-25 17:39:24 +00:00
PropertyCall.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
PropertyLoads.golden [inspector] moved var initialization break location before init expression (reland) 2017-05-30 12:54:49 +00:00
PropertyStores.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
RegExpLiterals.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
RegExpLiteralsWide.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
RemoveRedundantLdar.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
StandardForLoop.golden [parser] Better error message when destructuring against undefined/null 2017-06-15 21:52:58 +00:00
StoreGlobal.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
StringConcat.golden [Interpreter] Add StringConcat bytecode. 2017-05-22 11:44:27 +00:00
StringConstants.golden [interpreter] Remove redundant flag from bytecode cctest suite. 2016-10-04 16:30:15 +00:00
SuperCallAndSpread.golden [ignition] Fix register flushing performance issue 2017-06-09 09:58:15 +00:00
Switch.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
ThisFunction.golden [interpreter] Remove redundant flag from bytecode cctest suite. 2016-10-04 16:30:15 +00:00
Throw.golden [ignition] Expect 'I' for signed bytecode operands 2017-01-25 17:39:24 +00:00
TopLevelObjectLiterals.golden [runtime] Directly support double values in CloneShallowObjectLiteral 2017-05-29 13:27:17 +00:00
TryCatch.golden [Interpreter] Allocate context registers as temporary registers. 2017-05-24 17:12:02 +00:00
TryFinally.golden [Interpreter] Allocate context registers as temporary registers. 2017-05-24 17:12:02 +00:00
Typeof.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
UnaryOperators.golden Reland: [TypeFeedbackVector] Store optimized code in the vector 2017-05-10 15:04:35 +00:00
WideRegisters.golden [ignition] Fix register flushing performance issue 2017-06-09 09:58:15 +00:00
WithStatement.golden [runtime] Directly support double values in CloneShallowObjectLiteral 2017-05-29 13:27:17 +00:00