v8/test/cctest/interpreter
Daniel Ehrenberg d54ffadfda [scopes] Fix sloppy-mode block-scoped function hoisting edge case
In edge cases such as the following, sloppy-mode block-scoped function
hoisting is expected to occur:

  eval(`
    with({a: 1}) {
      function a() {}
    }
  `)

In this case, there should be the equivalent of a var declaration
outside of the eval, which gets set to the value of the local function
a when the body of the with is executed.

Previously, the way that var declarations are hoisted out of eval
meant that the assignment to that var was an ordinary DYNAMIC_GLOBAL
assignment. However, such a lookup mode meant that the object in the
with scope received the assignment!

This patch fixes that error by marking the assignments produced by
the sloppy mode block scoped function hoisting desugaring so as to
generate a different runtime call which skips with scopes.

Bug: chromium:720247, v8:5135
Change-Id: Ie36322ddc9ca848bf680163e8c016f50d4597748
Reviewed-on: https://chromium-review.googlesource.com/529230
Commit-Queue: Daniel Ehrenberg <littledan@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46116}
2017-06-22 08:18:55 +00:00
..
bytecode_expectations [scopes] Fix sloppy-mode block-scoped function hoisting edge case 2017-06-22 08:18:55 +00:00
bytecode-expectations-printer.cc [inspector] cache stack frame for call sites 2017-04-12 18:33:20 +00:00
bytecode-expectations-printer.h [interpreter] Add some bytecode tests for modules. 2016-10-04 18:42:36 +00:00
generate-bytecode-expectations.cc [cleanup] Remove return after UNREACHABLE 2017-05-22 13:10:01 +00:00
interpreter-tester.cc Rename TypeFeedbackVector to FeedbackVector. 2017-02-07 14:46:36 +00:00
interpreter-tester.h Link type feedback vectors to the shared function info. 2017-02-08 08:33:33 +00:00
source-position-matcher.cc [inspector] cache stack frame for call sites 2017-04-12 18:33:20 +00:00
source-position-matcher.h
test-bytecode-generator.cc [generators] Improve yield* desugaring to save unnecessary try/catch and try/finally 2017-05-22 16:08:41 +00:00
test-interpreter-intrinsics.cc [interpreter] Split function into Receiver() and Parameter(i). 2017-03-30 09:40:08 +00:00
test-interpreter.cc [TurboFan] Add typing for the EmptyString and use this for JSToPrimitiveToString 2017-06-08 09:51:26 +00:00
test-source-positions.cc [Interpreter] Move dead code elimination to BytecodeArrayWriter. 2017-04-11 12:39:14 +00:00