diff --git a/test/language/expressions/arrow-function/arrow/binding-tests-1.js b/test/language/expressions/arrow-function/arrow/binding-tests-1.js new file mode 100644 index 0000000000000000000000000000000000000000..67b9e2642e0f67763f98c1a23b723b2466bab838 --- /dev/null +++ b/test/language/expressions/arrow-function/arrow/binding-tests-1.js @@ -0,0 +1,14 @@ +// Copyright 2015 Microsoft Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/*--- +description: this binding tests +flags: [noStrict] +es6id: 14.2 +---*/ + +function foo(){ + return eval("()=>this"); + } + +assert.sameValue(foo()(), this, "This binding initialization was incorrect for arrow capturing this from closure."); diff --git a/test/language/expressions/arrow-function/arrow/binding-tests-2.js b/test/language/expressions/arrow-function/arrow/binding-tests-2.js new file mode 100644 index 0000000000000000000000000000000000000000..67b9e2642e0f67763f98c1a23b723b2466bab838 --- /dev/null +++ b/test/language/expressions/arrow-function/arrow/binding-tests-2.js @@ -0,0 +1,14 @@ +// Copyright 2015 Microsoft Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/*--- +description: this binding tests +flags: [noStrict] +es6id: 14.2 +---*/ + +function foo(){ + return eval("()=>this"); + } + +assert.sameValue(foo()(), this, "This binding initialization was incorrect for arrow capturing this from closure."); diff --git a/test/language/expressions/arrow-function/arrow/binding-tests-3.js b/test/language/expressions/arrow-function/arrow/binding-tests-3.js new file mode 100644 index 0000000000000000000000000000000000000000..0610010b047f38297d2259a4b2f4a31db108aa72 --- /dev/null +++ b/test/language/expressions/arrow-function/arrow/binding-tests-3.js @@ -0,0 +1,14 @@ +// Copyright 2015 Microsoft Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/*--- +description: this binding tests +flags: [noStrict] +es6id: 14.2 +---*/ + +function foo(){ + return ()=>eval("this"); + } + +assert.sameValue(eval("foo()()"), this, "This binding initialization was incorrect for arrow capturing this from closure."); diff --git a/test/language/expressions/arrow-function/arrow/capturing-closure-variables-1.js b/test/language/expressions/arrow-function/arrow/capturing-closure-variables-1.js new file mode 100644 index 0000000000000000000000000000000000000000..f5f7928647b8a62ba5286673273798deae425a95 --- /dev/null +++ b/test/language/expressions/arrow-function/arrow/capturing-closure-variables-1.js @@ -0,0 +1,15 @@ +// Copyright 2015 Microsoft Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/*--- +description: Capturing closure variables +es6id: 14.2 +---*/ + +var a; +function foo(){ + eval("a = 10"); + return ()=>a; + } + +assert.sameValue(foo()(), 10, "Closure variable was captured incorrectly."); diff --git a/test/language/expressions/arrow-function/arrow/capturing-closure-variables-2.js b/test/language/expressions/arrow-function/arrow/capturing-closure-variables-2.js new file mode 100644 index 0000000000000000000000000000000000000000..05800d46dc827acecb6c395e56276ae5de8ecde5 --- /dev/null +++ b/test/language/expressions/arrow-function/arrow/capturing-closure-variables-2.js @@ -0,0 +1,17 @@ +// Copyright 2015 Microsoft Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/*--- +description: Capturing closure variables - with +es6id: 14.2 +flags: [noStrict] +---*/ + +function foo(){ + var a = {a : 10}; + with(a){ + return () => a; + } + } + +assert.sameValue(foo()(), 10, "Closure variable was captured incorrectly."); diff --git a/test/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-1.js b/test/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-1.js new file mode 100644 index 0000000000000000000000000000000000000000..4777db00b889632e10fa0bcf8f3bae6f75912e51 --- /dev/null +++ b/test/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-1.js @@ -0,0 +1,9 @@ +// Copyright 2015 Microsoft Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/*--- +description: "ConciseBody :[lookahead { { }] AssignmentExpression" +es6id: 14.2 +---*/ + +x => x => x diff --git a/test/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-2.js b/test/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-2.js new file mode 100644 index 0000000000000000000000000000000000000000..a7beb6bf192414bf33071c0a049031f8a6346891 --- /dev/null +++ b/test/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-2.js @@ -0,0 +1,9 @@ +// Copyright 2015 Microsoft Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/*--- +description: "ConciseBody :[lookahead { { }] AssignmentExpression" +es6id: 14.2 +---*/ + +x => function(){}