v8/test/cctest
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
..
compiler [fullcodegen] Remove support for bailout preparation. 2017-06-14 10:48:02 +00:00
ffi Add COMPONENT tags to OWNERS files where appropriate 2017-05-22 10:15:28 +00:00
heap [heap] Build proper iterator for iterating live objects 2017-06-21 12:20:14 +00:00
interpreter [scopes] Fix sloppy-mode block-scoped function hoisting edge case 2017-06-22 08:18:55 +00:00
libplatform [Tracing] Support multi-categories group list. 2016-12-08 00:28:18 +00:00
libsampler Include only stuff you need, part 6: Fix cctest.h. 2016-09-01 12:02:16 +00:00
parsing Reland#2 [parser] Refactor streaming scanner streams. 2017-06-19 10:18:01 +00:00
wasm [wasm] Remove the wasm-asmjs fuzzer 2017-06-21 10:59:35 +00:00
ast-types-fuzz.h Remove SIMD.js from V8. 2017-02-14 06:57:25 +00:00
BUILD.gn [wasm] Make prototype flags experimental 2017-05-31 14:18:08 +00:00
cctest_exe.isolate
cctest.cc Rename "NoBarrier" memory operations to "Relaxed". 2017-05-30 07:44:37 +00:00
cctest.gyp [cleanup] Remove unnecessary entries in cctest.status 2017-06-09 16:05:09 +00:00
cctest.h [heap] Disable concurrent marking for cctest that rely on manual GC. 2017-06-12 11:55:38 +00:00
cctest.isolate [Interpreter] Refactor bytecode generator test suite. 2016-02-25 12:07:19 +00:00
cctest.status [wasm] [cleanup] Avoid shouting WASM 2017-06-09 16:24:19 +00:00
DEPS
expression-type-collector-macros.h
gay-fixed.cc
gay-fixed.h
gay-precision.cc
gay-precision.h
gay-shortest.cc
gay-shortest.h
log-eq-of-logging-and-traversal.js
OWNERS Update MIPS owners 2017-05-12 10:06:35 +00:00
print-extension.cc
print-extension.h
profiler-extension.cc Introduce v8::CpuProfiler::New and v8::CpuProfiler::Dispose API. 2016-07-08 15:01:10 +00:00
profiler-extension.h Introduce v8::CpuProfiler::New and v8::CpuProfiler::Dispose API. 2016-07-08 15:01:10 +00:00
scope-test-helper.h [parser] Skipping inner funcs: fix preparsing super. 2017-05-17 13:42:41 +00:00
setup-isolate-for-tests.cc Reland "[snapshot] Move builtins generation into mksnapshot" 2017-04-07 13:31:29 +00:00
setup-isolate-for-tests.h [cleanup] Remove unnecessary entries in cctest.status 2017-06-09 16:05:09 +00:00
test-access-checks.cc Fix receiver checks for v8::Function on a remote context receiver. 2017-02-22 10:13:24 +00:00
test-accessor-assembler.cc [csa] Enforce using BIND macro 2017-05-19 16:47:56 +00:00
test-accessors.cc [cctest] Simplify the majority of callers of CcTest::CollectAllGarbage 2017-04-27 17:20:54 +00:00
test-api-accessors.cc Remove experimental fast accessor builder API 2017-03-14 08:14:48 +00:00
test-api-interceptors.cc Use --opt instead of --crankshaft in tests. 2017-04-28 14:20:39 +00:00
test-api.cc [heap] Allow a minimum semi-space size of 512K. 2017-06-19 10:16:13 +00:00
test-api.h Include only stuff you need, part 6: Fix cctest.h. 2016-09-01 12:02:16 +00:00
test-array-list.cc Rename TypeFeedbackVector to FeedbackVector. 2017-02-07 14:46:36 +00:00
test-assembler-arm64.cc [arm64] Fix assertion in IsImmLLiteral and enable literal pool tests. 2017-06-14 13:52:00 +00:00
test-assembler-arm.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-assembler-ia32.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-assembler-mips64.cc MIPS64: Add optimizations to li and Dsubu macro. 2017-06-19 12:20:17 +00:00
test-assembler-mips.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-assembler-ppc.cc PPC/s390: [compiler] Delay allocation of code-embedded heap numbers. 2017-06-08 17:41:56 +00:00
test-assembler-s390.cc PPC/s390: [compiler] Delay allocation of code-embedded heap numbers. 2017-06-08 17:41:56 +00:00
test-assembler-x64.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-assembler-x87.cc [test] Make CHECK_EQ calls in cctest consistent. 2017-02-07 14:20:02 +00:00
test-ast-types.cc Rename TypeFeedbackVector to FeedbackVector. 2017-02-07 14:46:36 +00:00
test-ast.cc [parser|ast] Simplify AstNodeFactory Zone usage. 2017-05-17 12:15:18 +00:00
test-atomicops.cc Rename "NoBarrier" memory operations to "Relaxed". 2017-05-30 07:44:37 +00:00
test-bignum-dtoa.cc
test-bignum.cc
test-bit-vector.cc [bitvector] Allow BitVector to resize 2017-06-21 15:13:05 +00:00
test-circular-queue.cc
test-code-cache.cc [ic] Cleanup accessor handling, fix cached property on global, remove cache-on-prototype support 2017-03-15 16:42:51 +00:00
test-code-layout.cc Rename TypeFeedbackVector to FeedbackVector. 2017-02-07 14:46:36 +00:00
test-code-stub-assembler.cc [csa] Enforce using BIND macro 2017-05-19 16:47:56 +00:00
test-code-stubs-arm64.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-code-stubs-arm.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-code-stubs-ia32.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-code-stubs-mips64.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-code-stubs-mips.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-code-stubs-x64.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-code-stubs-x87.cc [RegisterConfiguration] Streamline access to arch defaults, simplify Registers. 2016-06-27 15:31:31 +00:00
test-code-stubs.cc [iwyu] Pre-work for removing unallowed include macro-assembler.h -> assembler-inl.h 2017-02-23 12:10:21 +00:00
test-code-stubs.h
test-compiler.cc [fullcodegen] Remove support for bailout preparation. 2017-06-14 10:48:02 +00:00
test-constantpool.cc
test-conversions.cc Rename TypeFeedbackVector to FeedbackVector. 2017-02-07 14:46:36 +00:00
test-cpu-profiler.cc Remove crankshaft flag. 2017-05-15 12:34:20 +00:00
test-date.cc [intl] Reorganize code 2017-04-24 13:54:15 +00:00
test-debug.cc Decouple the --ignition from the --turbo flag. 2017-06-09 08:04:39 +00:00
test-decls.cc [runtime] Intercept function declarations. 2016-09-15 15:48:34 +00:00
test-deoptimization.cc [heap] More cctest fixes for concurrent marker. 2017-06-13 09:55:17 +00:00
test-dictionary.cc [runtime] Devirtualize CompilationCacheKey::HashForObject 2017-06-12 17:00:52 +00:00
test-disasm-arm64.cc [arm64] Fix assertion in IsImmLLiteral and enable literal pool tests. 2017-06-14 13:52:00 +00:00
test-disasm-arm.cc [ARM] Improve VFP register moves. 2017-05-16 20:37:16 +00:00
test-disasm-ia32.cc [ia32] Add pextrb/pextrw, pinsrb, pshufb/pshuflw and AVX version 2017-06-13 02:06:17 +00:00
test-disasm-mips64.cc MIPS[64]: Support for some SIMD operations (8) 2017-06-01 13:25:50 +00:00
test-disasm-mips.cc MIPS[64]: Support for some SIMD operations (8) 2017-06-01 13:25:50 +00:00
test-disasm-ppc.cc
test-disasm-s390.cc S390: Initial test changes and files checkin. 2016-03-15 18:09:36 +00:00
test-disasm-x64.cc [cleanup] Remove duplicate Callable accessors from CodeFactory 2017-06-12 09:24:17 +00:00
test-disasm-x87.cc [cleanup] Remove duplicate Callable accessors from CodeFactory 2017-06-12 09:24:17 +00:00
test-diy-fp.cc
test-double.cc
test-dtoa.cc
test-elements-kind.cc [iwyu] Pre-work for removing unallowed include macro-assembler.h -> assembler-inl.h 2017-02-23 12:10:21 +00:00
test-experimental-extra.js
test-extra.js Add isPromise V8 extras util 2017-04-06 13:16:35 +00:00
test-fast-dtoa.cc
test-feedback-vector.cc Unify implementations of Map handles vectors and lists 2017-05-09 22:36:00 +00:00
test-feedback-vector.h [objects.h splitting] Move SharedFunctionInfo. 2017-05-29 14:03:48 +00:00
test-field-type-tracking.cc [runtime] Drop PrototypeOptimizationMode to unify prototype handling 2017-06-08 08:00:37 +00:00
test-fixed-dtoa.cc
test-flags.cc Use --opt instead of --crankshaft in tests. 2017-04-28 14:20:39 +00:00
test-func-name-inference.cc [iwyu] Remove include debug.h -> arguments.h 2017-02-09 09:19:23 +00:00
test-fuzz-arm64.cc
test-global-handles.cc Drop UniqueId from include/v8.h 2017-03-06 10:58:01 +00:00
test-global-object.cc include fixing: api.h shouldn't include objects-inl.h 2017-01-09 13:43:28 +00:00
test-hashing.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-hashmap.cc Instead of having a hashmap with a function pointer defining its 2016-09-30 16:17:06 +00:00
test-heap-profiler.cc [heap] Add --stress-incremental-marking flag. 2017-05-29 11:06:13 +00:00
test-hydrogen-types.cc
test-identity-map.cc Reland: [IdentityMap] Fix size if GC short-cuts objects. 2017-06-21 09:37:20 +00:00
test-inobject-slack-tracking.cc [runtime] Directly support double values in CloneShallowObjectLiteral 2017-05-29 13:27:17 +00:00
test-javascript-arm64.cc include fixing: api.h shouldn't include objects-inl.h 2017-01-09 13:43:28 +00:00
test-js-arm64-variables.cc include fixing: api.h shouldn't include objects-inl.h 2017-01-09 13:43:28 +00:00
test-list.cc Include only stuff you need, part 6: Fix cctest.h. 2016-09-01 12:02:16 +00:00
test-liveedit.cc include fixing: api.h shouldn't include objects-inl.h 2017-01-09 13:43:28 +00:00
test-lockers.cc include fixing: api.h shouldn't include objects-inl.h 2017-01-09 13:43:28 +00:00
test-log-stack-tracer.cc [iwyu] Pre-work for removing unallowed include macro-assembler.h -> assembler-inl.h 2017-02-23 12:10:21 +00:00
test-log.cc [profiler] Web UI: add summary of opts/deopts. 2017-03-22 16:02:25 +00:00
test-macro-assembler-arm.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-macro-assembler-ia32.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-macro-assembler-mips64.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-macro-assembler-mips.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-macro-assembler-x64.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-macro-assembler-x87.cc
test-managed.cc Implement managed objects with phantom handles 2017-06-20 10:58:45 +00:00
test-mementos.cc [heap] Fix verification of unsafe object layout changes. 2017-05-18 19:24:22 +00:00
test-modules.cc Added v8::Module::GetModuleRequestPosition method 2017-06-21 16:00:14 +00:00
test-object.cc Remove SIMD.js from V8. 2017-02-14 06:57:25 +00:00
test-orderedhashtable.cc [Collections] Change ::HasKey to return bool 2017-06-20 18:45:27 +00:00
test-parsing.cc Reland "[parser] Forbid \08 in strict strings" 2017-06-21 17:41:46 +00:00
test-platform-linux.cc
test-platform-win32.cc
test-platform.cc S390:Update inline asm constraint in test-platform 2016-07-16 15:36:45 +00:00
test-profile-generator.cc [compiler] Unplug Crankshaft from compilation pipeline. 2017-06-09 09:26:47 +00:00
test-random-number-generator.cc Include only stuff you need, part 6: Fix cctest.h. 2016-09-01 12:02:16 +00:00
test-regexp.cc [regexp] Fold repeated assertions 2017-03-22 09:28:28 +00:00
test-representation.cc [turbofan] put src/types.[h/cc] into src/compiler/types.[h/cc] 2016-09-05 15:58:45 +00:00
test-run-wasm-relocation-arm64.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-run-wasm-relocation-arm.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-run-wasm-relocation-ia32.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-run-wasm-relocation-x64.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-run-wasm-relocation-x87.cc [wasm] Fix code specialization for empty memory buffer 2017-03-06 13:39:54 +00:00
test-sampler-api.cc Include only stuff you need, part 6: Fix cctest.h. 2016-09-01 12:02:16 +00:00
test-serialize.cc [heap] TSAN annotation for mark-bits initialization. 2017-06-13 15:17:45 +00:00
test-simulator-arm64.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-simulator-arm.cc [compiler] Delay allocation of code-embedded heap numbers. 2017-05-31 14:00:11 +00:00
test-strings.cc [heap] Allow a minimum semi-space size of 512K. 2017-06-19 10:16:13 +00:00
test-strtod.cc
test-symbols.cc [cctest] Simplify the majority of callers of CcTest::CollectAllGarbage 2017-04-27 17:20:54 +00:00
test-thread-termination.cc Assert that context creation doesn't throw 2017-01-17 13:01:03 +00:00
test-threads.cc Include only stuff you need, part 6: Fix cctest.h. 2016-09-01 12:02:16 +00:00
test-trace-event.cc [tracing] Avoid Gcc compilation fail by declaring AddTraceEvent function in Class derived from Platform Class. 2016-09-28 08:47:33 +00:00
test-traced-value.cc [tracing] Use locale independent writer for FP values. 2017-01-12 08:08:57 +00:00
test-transitions.cc [runtime][ic] Constant field tracking support. 2017-02-10 08:05:25 +00:00
test-typedarrays.cc include fixing: api.h shouldn't include objects-inl.h 2017-01-09 13:43:28 +00:00
test-types.cc [turbofan] Add SeqStringCharCodeAt operation. 2017-05-24 11:59:52 +00:00
test-unbound-queue.cc
test-unboxed-doubles.cc [heap] TSAN annotation for mark-bits initialization. 2017-06-13 15:17:45 +00:00
test-unique.cc Rename TypeFeedbackVector to FeedbackVector. 2017-02-07 14:46:36 +00:00
test-unscopables-hidden-prototype.cc
test-usecounters.cc [counters] Add UseCounters for 'f() = 0' syntax 2016-12-27 17:48:40 +00:00
test-utils-arm64.cc Reland of Reland of "ARM64: Add NEON support" 2017-05-31 13:58:43 +00:00
test-utils-arm64.h Reland of Reland of "ARM64: Add NEON support" 2017-05-31 13:58:43 +00:00
test-utils.cc Allow C++11 in unittests. 2017-03-10 06:35:51 +00:00
test-version.cc Revert of [build] Introduce an embedder version string (patchset #3 id:40001 of https://codereview.chromium.org/2619213002/ ) 2017-01-21 22:36:54 +00:00
test-weakmaps.cc Revert "[builtins] Move most WeakMap/WeakSet code from JS to C++ builtins" 2017-06-15 22:04:38 +00:00
test-weaksets.cc Revert "[builtins] Move most WeakMap/WeakSet code from JS to C++ builtins" 2017-06-15 22:04:38 +00:00
testcfg.py [test] Fix deterministic test shards. 2016-03-31 07:38:22 +00:00
trace-extension.cc Expose TickSample and its APIs in v8-profiler.h 2016-07-06 18:40:31 +00:00
trace-extension.h Expose TickSample and its APIs in v8-profiler.h 2016-07-06 18:40:31 +00:00
types-fuzz.h [turbofan] HeapConstant types should compare by handle address 2016-10-08 16:51:53 +00:00
unicode-helpers.h [parser/test] Move cctest/PreParserScopeAnalysis into a new file. 2017-02-07 10:11:01 +00:00