diff options
Diffstat (limited to 'js/src/tests/test262/language/expressions/arrow-function/arrow')
9 files changed, 106 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/arrow-function/arrow/binding-tests-1.js b/js/src/tests/test262/language/expressions/arrow-function/arrow/binding-tests-1.js new file mode 100644 index 0000000000..7d7a0d3ed1 --- /dev/null +++ b/js/src/tests/test262/language/expressions/arrow-function/arrow/binding-tests-1.js @@ -0,0 +1,16 @@ +// 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.");
+ +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/arrow-function/arrow/binding-tests-2.js b/js/src/tests/test262/language/expressions/arrow-function/arrow/binding-tests-2.js new file mode 100644 index 0000000000..7d7a0d3ed1 --- /dev/null +++ b/js/src/tests/test262/language/expressions/arrow-function/arrow/binding-tests-2.js @@ -0,0 +1,16 @@ +// 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.");
+ +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/arrow-function/arrow/binding-tests-3.js b/js/src/tests/test262/language/expressions/arrow-function/arrow/binding-tests-3.js new file mode 100644 index 0000000000..5925e477f5 --- /dev/null +++ b/js/src/tests/test262/language/expressions/arrow-function/arrow/binding-tests-3.js @@ -0,0 +1,16 @@ +// 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.");
+ +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/arrow-function/arrow/browser.js b/js/src/tests/test262/language/expressions/arrow-function/arrow/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/expressions/arrow-function/arrow/browser.js diff --git a/js/src/tests/test262/language/expressions/arrow-function/arrow/capturing-closure-variables-1.js b/js/src/tests/test262/language/expressions/arrow-function/arrow/capturing-closure-variables-1.js new file mode 100644 index 0000000000..237c76486d --- /dev/null +++ b/js/src/tests/test262/language/expressions/arrow-function/arrow/capturing-closure-variables-1.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
+es6id: 14.2
+---*/
+
+var a;
+function foo(){
+ eval("a = 10");
+ return ()=>a;
+ }
+
+assert.sameValue(foo()(), 10, "Closure variable was captured incorrectly.");
+ +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/arrow-function/arrow/capturing-closure-variables-2.js b/js/src/tests/test262/language/expressions/arrow-function/arrow/capturing-closure-variables-2.js new file mode 100644 index 0000000000..76ecabb129 --- /dev/null +++ b/js/src/tests/test262/language/expressions/arrow-function/arrow/capturing-closure-variables-2.js @@ -0,0 +1,19 @@ +// 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.");
+ +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-1.js b/js/src/tests/test262/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-1.js new file mode 100644 index 0000000000..8df3661ffa --- /dev/null +++ b/js/src/tests/test262/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-1.js @@ -0,0 +1,11 @@ +// 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
+ +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-2.js b/js/src/tests/test262/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-2.js new file mode 100644 index 0000000000..0365eebc2f --- /dev/null +++ b/js/src/tests/test262/language/expressions/arrow-function/arrow/concisebody-lookahead-assignmentexpression-2.js @@ -0,0 +1,11 @@ +// 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(){}
+ +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/arrow-function/arrow/shell.js b/js/src/tests/test262/language/expressions/arrow-function/arrow/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/expressions/arrow-function/arrow/shell.js |