v8/test/mjsunit/harmony
littledan e5ff10d767 Implement sloppy-mode block-defined functions (Annex B 3.3)
ES2015 specifies very particular semantics for functions defined in blocks.
In strict mode, it is simply a lexical binding scoped to that block. In sloppy
mode, in addition to that lexical binding, there is a var-style binding in
the outer scope, which is overwritten with the local binding when the function
declaration is evaluated, *as long as* introducing ths var binding would not
create a var/let conflict in the outer scope.

This patch implements the semantics by introducing a DelegateStatement, which
is initially filled in with the EmptyStatement and overwritten with the
assignment when the scope is closed out and it can be checked that there is
no conflict.

This patch is tested with a new mjsunit test, and I tried staging it and running
test262, finding that the tests that we have disabled due to lack of Annex B
support now pass.

R=adamk,rossberg
LOG=Y
BUG=v8:4285

Review URL: https://codereview.chromium.org/1332873003

Cr-Commit-Position: refs/heads/master@{#30842}
2015-09-21 04:31:09 +00:00
..
regress Fix spread operator in ArrayLiterals when nested in other literals 2015-09-15 16:43:39 +00:00
array-concat.js Guard @@isConcatSpreadable behind a flag 2015-07-08 21:49:58 +00:00
array-copywithin.js Revert of Revert of [es6] implement Array.prototype.copyWithin() (patchset #1 id:1 of https://codereview.chromium.org/1084183004/) 2015-04-22 09:43:13 +00:00
array-fill.js Fix typos in unit test for Array.prototype.fill() 2014-05-09 16:11:50 +00:00
array-find.js [es6] Array.prototype.find and findIndex should include holes 2015-06-05 14:18:20 +00:00
array-findindex.js [es6] Array.prototype.find and findIndex should include holes 2015-06-05 14:18:20 +00:00
array-from.js In Array.of and Array.from, fall back to DefineOwnProperty 2015-06-11 20:41:04 +00:00
array-includes-to-object-sloppy.js Add Array.prototype.includes 2014-12-10 08:58:15 +00:00
array-includes-to-object-strict.js Add Array.prototype.includes 2014-12-10 08:58:15 +00:00
array-includes.js Add Array.prototype.includes 2014-12-10 08:58:15 +00:00
array-length.js ES6: Array.prototype.slice and friends should use ToLength instead of ToUint32 2015-09-16 18:01:52 +00:00
array-of.js In Array.of and Array.from, fall back to DefineOwnProperty 2015-06-11 20:41:04 +00:00
arrow-functions-lexical-arguments.js [es6] Remove harmony-classes flag 2015-06-26 21:16:58 +00:00
arrow-functions-this.js Reapply "Resolve references to "this" the same way as normal variables"" 2015-05-19 14:50:59 +00:00
arrow-functions.js [es6] do not add caller/arguments to ES6 function definitions 2015-04-09 22:40:28 +00:00
arrow-rest-params-lazy-parsing.js [es6] Re-implement rest parameters via desugaring. 2015-09-02 21:11:05 +00:00
arrow-rest-params.js [parser] disallow language mode directive in body of function with non-simple parameters 2015-08-26 14:59:19 +00:00
atomics.js [Atomics] Remove support for atomic accesses on floating-point values. 2015-09-15 21:25:14 +00:00
block-conflicts-sloppy.js Add class to existing lexical scoping tests 2015-08-12 18:43:06 +00:00
block-const-assign-sloppy.js Delete --harmony-computed-property-names flag 2015-08-05 21:32:38 +00:00
block-for-sloppy.js Split off a separate --harmony_sloppy_let flag 2015-07-25 00:05:18 +00:00
block-lazy-compile.js Preliminary code for block scopes and block contexts. 2011-08-11 16:29:28 +00:00
block-leave-sloppy.js Split off a separate --harmony_sloppy_let flag 2015-07-25 00:05:18 +00:00
block-let-contextual-sloppy.js Sloppy-mode let parsing 2015-08-28 18:47:40 +00:00
block-let-crankshaft-sloppy.js Split off a separate --harmony_sloppy_let flag 2015-07-25 00:05:18 +00:00
block-let-declaration-sloppy.js Add class to existing lexical scoping tests 2015-08-12 18:43:06 +00:00
block-let-semantics-sloppy.js Implement sloppy-mode block-defined functions (Annex B 3.3) 2015-09-21 04:31:09 +00:00
block-scope-class.js Split function block scoping into a separate flag 2015-08-12 00:00:01 +00:00
block-scoping-sloppy.js Add class to existing lexical scoping tests 2015-08-12 18:43:06 +00:00
block-scoping-top-level-sloppy.js Split off a separate --harmony_sloppy_let flag 2015-07-25 00:05:18 +00:00
block-sloppy-function.js Implement sloppy-mode block-defined functions (Annex B 3.3) 2015-09-21 04:31:09 +00:00
classes-derived-return-type.js [es6] Fix return checking in derived constructors 2015-04-28 16:09:30 +00:00
dataview-accessors.js Fix data view accessors to throw execptions on offsets bigger than size_t. 2013-11-18 15:16:22 +00:00
default-parameters-debug.js [es6] Implement default parameters 2015-08-17 12:02:08 +00:00
default-parameters.js [parser] disallow language mode directive in body of function with non-simple parameters 2015-08-26 14:59:19 +00:00
destructuring-parameters-literalcount-nolazy.js Delete --harmony-computed-property-names flag 2015-08-05 21:32:38 +00:00
destructuring-parameters-literalcount.js Delete --harmony-computed-property-names flag 2015-08-05 21:32:38 +00:00
destructuring.js [es6] support get and set in shorthand properties 2015-09-16 16:02:05 +00:00
futex.js Remove harmony-atomics flag and collapse it into sharedarraybuffer flag 2015-09-01 18:34:00 +00:00
module-linking.js Remove --harmony-scoping flag. 2015-03-13 15:15:57 +00:00
module-parsing-eval.js Enable compiling mjsunit tests as ES6 modules 2015-02-10 19:11:55 +00:00
module-recompile.js Implement proper module linking. 2012-07-09 08:59:03 +00:00
module-resolution.js Remove --harmony-scoping flag. 2015-03-13 15:15:57 +00:00
modules.js Enable compiling mjsunit tests as ES6 modules 2015-02-10 19:11:55 +00:00
new-target.js [parser] make kInvalidLhsInFor a SyntaxError 2015-08-15 17:57:16 +00:00
object-literals-super.js [es6] Remove harmony-classes flag 2015-06-26 21:16:58 +00:00
private.js All private symbols are own symbols 2015-06-16 08:13:42 +00:00
proxies-example-membrane.js Remove proxies from --harmony switch for M38, because problems 2014-08-08 09:58:19 +00:00
proxies-for.js Fix ToNameArray 2015-05-22 10:57:20 +00:00
proxies-function.js [runtime] Replace many buggy uses of %_CallFunction with %_Call. 2015-09-08 13:35:32 +00:00
proxies-hash.js Enable ES6 Map and Set by default 2014-08-05 19:37:32 +00:00
proxies-json.js Remove proxies from --harmony switch for M38, because problems 2014-08-08 09:58:19 +00:00
proxies-symbols.js Enable ES6 Symbols by default 2014-08-04 18:17:54 +00:00
proxies-with-unscopables.js ES6: Update unscopables to match spec 2014-12-16 20:07:41 +00:00
proxies-with.js Proxies: Make 'with' work, plus minor other fixes 2013-07-19 14:07:23 +00:00
proxies.js Fix keyed stores to strings convertible to indices 2015-07-13 10:46:35 +00:00
reflect-apply.js [es6] implement Reflect.apply() & Reflect.construct() 2015-03-19 14:47:27 +00:00
reflect-construct.js [es6] implement Reflect.apply() & Reflect.construct() 2015-03-19 14:47:27 +00:00
regexp-flags.js Split --harmony-unicode and --harmony-unicode-regexps. 2015-02-05 14:17:09 +00:00
regexp-sticky.js Reland sticky regexps https://codereview.chromium.org/567313003/ 2014-09-19 07:36:05 +00:00
rest-params-lazy-parsing.js Support rest parameters in arrow functions 2015-06-10 16:11:31 +00:00
rest-params.js [es6] Re-implement rest parameters via desugaring. 2015-09-02 21:11:05 +00:00
set-prototype-of.js [es6] throw TypeError when setting cyclic prototype value 2015-06-19 22:18:36 +00:00
sharedarraybuffer.js Revert of Add %TypedArray% to proto chain (patchset #6 id:100001 of https://codereview.chromium.org/1186733002/) 2015-06-17 09:05:51 +00:00
simd.js [simd.js] Update to spec version 0.8.2. 2015-08-25 12:35:19 +00:00
spread-array.js [es6] Spread in array literals 2015-05-21 08:08:55 +00:00
spread-call-new-class.js [es6] implement spread calls 2015-04-09 19:37:19 +00:00
spread-call-new.js [es6] implement spread calls 2015-04-09 19:37:19 +00:00
spread-call-super-property.js [parser] disallow language mode directive in body of function with non-simple parameters 2015-08-26 14:59:19 +00:00
spread-call.js [es6] implement spread calls 2015-04-09 19:37:19 +00:00
super.js [es6] Fix function context check for super and new.target 2015-07-23 09:58:59 +00:00
to-name.js [es6] Implement Date.prototype[@@toPrimitive] as C++ builtin. 2015-08-31 12:53:10 +00:00
to-number.js [es6] Implement Date.prototype[@@toPrimitive] as C++ builtin. 2015-08-31 12:53:10 +00:00
to-primitive.js [es6] Implement Date.prototype[@@toPrimitive] as C++ builtin. 2015-08-31 12:53:10 +00:00
to-string.js [es6] Implement Date.prototype[@@toPrimitive] as C++ builtin. 2015-08-31 12:53:10 +00:00
typed-array-includes.js Add includes method to typed arrays 2015-08-11 17:55:24 +00:00
unicode-escapes-in-regexps.js Split --harmony-unicode and --harmony-unicode-regexps. 2015-02-05 14:17:09 +00:00