summaryrefslogtreecommitdiff
path: root/test/annexB
diff options
context:
space:
mode:
authorLeonardo Balter <leonardo.balter@gmail.com>2017-03-06 16:03:59 -0500
committerLeonardo Balter <leonardo.balter@gmail.com>2017-03-06 16:05:38 -0500
commit874ce565ed695ad9878b6adec12d5d30b844014a (patch)
treee381e3a3929c48257f2f4e1a7ed187136c97ff50 /test/annexB
parent60303b9f0763967b56bd3d1bc3352f9d6b4fcf1a (diff)
downloadqtdeclarative-testsuites-874ce565ed695ad9878b6adec12d5d30b844014a.tar.gz
Generate tests
Diffstat (limited to 'test/annexB')
-rw-r--r--test/annexB/language/function-code/block-decl-func-skip-dft-param.js31
-rw-r--r--test/annexB/language/function-code/if-decl-else-decl-a-func-skip-dft-param.js38
-rw-r--r--test/annexB/language/function-code/if-decl-else-decl-b-func-skip-dft-param.js38
-rw-r--r--test/annexB/language/function-code/if-decl-else-stmt-func-skip-dft-param.js38
-rw-r--r--test/annexB/language/function-code/if-decl-no-else-func-skip-dft-param.js38
-rw-r--r--test/annexB/language/function-code/if-stmt-else-decl-func-skip-dft-param.js38
-rw-r--r--test/annexB/language/function-code/switch-case-func-skip-dft-param.js32
-rw-r--r--test/annexB/language/function-code/switch-dflt-func-skip-dft-param.js32
8 files changed, 285 insertions, 0 deletions
diff --git a/test/annexB/language/function-code/block-decl-func-skip-dft-param.js b/test/annexB/language/function-code/block-decl-func-skip-dft-param.js
new file mode 100644
index 000000000..66a0277f8
--- /dev/null
+++ b/test/annexB/language/function-code/block-decl-func-skip-dft-param.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/annex-b-fns/func-skip-dft-param.case
+// - src/annex-b-fns/func/block.template
+/*---
+description: Extension not observed when there is a default parameter with the same name (Block statement in function scope containing a function declaration)
+esid: sec-web-compat-functiondeclarationinstantiation
+es6id: B.3.3.1
+flags: [generated, noStrict]
+info: |
+ B.3.3.1 Changes to FunctionDeclarationInstantiation
+
+ [...]
+ ii. If replacing the FunctionDeclaration f with a VariableStatement that
+ has F as a BindingIdentifier would not produce any Early Errors for
+ func and F is not an element of BoundNames of argumentsList, then
+ [...]
+---*/
+var init, after;
+
+(function(f = 123) {
+ init = f;
+
+ {
+ function f() { }
+ }
+
+ after = f;
+}());
+
+assert.sameValue(init, 123, 'binding is not initialized to `undefined`');
+assert.sameValue(after, 123, 'value is not updated following evaluation');
diff --git a/test/annexB/language/function-code/if-decl-else-decl-a-func-skip-dft-param.js b/test/annexB/language/function-code/if-decl-else-decl-a-func-skip-dft-param.js
new file mode 100644
index 000000000..433480599
--- /dev/null
+++ b/test/annexB/language/function-code/if-decl-else-decl-a-func-skip-dft-param.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/annex-b-fns/func-skip-dft-param.case
+// - src/annex-b-fns/func/if-decl-else-decl-a.template
+/*---
+description: Extension not observed when there is a default parameter with the same name (IfStatement with a declaration in both statement positions in function scope)
+esid: sec-functiondeclarations-in-ifstatement-statement-clauses
+es6id: B.3.4
+flags: [generated, noStrict]
+info: |
+ The following rules for IfStatement augment those in 13.6:
+
+ IfStatement[Yield, Return]:
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else Statement[?Yield, ?Return]
+ if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else FunctionDeclaration[?Yield]
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else FunctionDeclaration[?Yield]
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield]
+
+
+ B.3.3.1 Changes to FunctionDeclarationInstantiation
+
+ [...]
+ ii. If replacing the FunctionDeclaration f with a VariableStatement that
+ has F as a BindingIdentifier would not produce any Early Errors for
+ func and F is not an element of BoundNames of argumentsList, then
+ [...]
+---*/
+var init, after;
+
+(function(f = 123) {
+ init = f;
+
+ if (true) function f() { } else function _f() {}
+
+ after = f;
+}());
+
+assert.sameValue(init, 123, 'binding is not initialized to `undefined`');
+assert.sameValue(after, 123, 'value is not updated following evaluation');
diff --git a/test/annexB/language/function-code/if-decl-else-decl-b-func-skip-dft-param.js b/test/annexB/language/function-code/if-decl-else-decl-b-func-skip-dft-param.js
new file mode 100644
index 000000000..2219770e5
--- /dev/null
+++ b/test/annexB/language/function-code/if-decl-else-decl-b-func-skip-dft-param.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/annex-b-fns/func-skip-dft-param.case
+// - src/annex-b-fns/func/if-decl-else-decl-b.template
+/*---
+description: Extension not observed when there is a default parameter with the same name (IfStatement with a declaration in both statement positions in function scope)
+esid: sec-functiondeclarations-in-ifstatement-statement-clauses
+es6id: B.3.4
+flags: [generated, noStrict]
+info: |
+ The following rules for IfStatement augment those in 13.6:
+
+ IfStatement[Yield, Return]:
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else Statement[?Yield, ?Return]
+ if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else FunctionDeclaration[?Yield]
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else FunctionDeclaration[?Yield]
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield]
+
+
+ B.3.3.1 Changes to FunctionDeclarationInstantiation
+
+ [...]
+ ii. If replacing the FunctionDeclaration f with a VariableStatement that
+ has F as a BindingIdentifier would not produce any Early Errors for
+ func and F is not an element of BoundNames of argumentsList, then
+ [...]
+---*/
+var init, after;
+
+(function(f = 123) {
+ init = f;
+
+ if (false) function _f() {} else function f() { }
+
+ after = f;
+}());
+
+assert.sameValue(init, 123, 'binding is not initialized to `undefined`');
+assert.sameValue(after, 123, 'value is not updated following evaluation');
diff --git a/test/annexB/language/function-code/if-decl-else-stmt-func-skip-dft-param.js b/test/annexB/language/function-code/if-decl-else-stmt-func-skip-dft-param.js
new file mode 100644
index 000000000..d0557e8c9
--- /dev/null
+++ b/test/annexB/language/function-code/if-decl-else-stmt-func-skip-dft-param.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/annex-b-fns/func-skip-dft-param.case
+// - src/annex-b-fns/func/if-decl-else-stmt.template
+/*---
+description: Extension not observed when there is a default parameter with the same name (IfStatement with a declaration in the first statement position in function scope)
+esid: sec-functiondeclarations-in-ifstatement-statement-clauses
+es6id: B.3.4
+flags: [generated, noStrict]
+info: |
+ The following rules for IfStatement augment those in 13.6:
+
+ IfStatement[Yield, Return]:
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else Statement[?Yield, ?Return]
+ if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else FunctionDeclaration[?Yield]
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else FunctionDeclaration[?Yield]
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield]
+
+
+ B.3.3.1 Changes to FunctionDeclarationInstantiation
+
+ [...]
+ ii. If replacing the FunctionDeclaration f with a VariableStatement that
+ has F as a BindingIdentifier would not produce any Early Errors for
+ func and F is not an element of BoundNames of argumentsList, then
+ [...]
+---*/
+var init, after;
+
+(function(f = 123) {
+ init = f;
+
+ if (true) function f() { } else ;
+
+ after = f;
+}());
+
+assert.sameValue(init, 123, 'binding is not initialized to `undefined`');
+assert.sameValue(after, 123, 'value is not updated following evaluation');
diff --git a/test/annexB/language/function-code/if-decl-no-else-func-skip-dft-param.js b/test/annexB/language/function-code/if-decl-no-else-func-skip-dft-param.js
new file mode 100644
index 000000000..9778293ea
--- /dev/null
+++ b/test/annexB/language/function-code/if-decl-no-else-func-skip-dft-param.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/annex-b-fns/func-skip-dft-param.case
+// - src/annex-b-fns/func/if-decl-no-else.template
+/*---
+description: Extension not observed when there is a default parameter with the same name (IfStatement without an else clause in function scope)
+esid: sec-functiondeclarations-in-ifstatement-statement-clauses
+es6id: B.3.4
+flags: [generated, noStrict]
+info: |
+ The following rules for IfStatement augment those in 13.6:
+
+ IfStatement[Yield, Return]:
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else Statement[?Yield, ?Return]
+ if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else FunctionDeclaration[?Yield]
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else FunctionDeclaration[?Yield]
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield]
+
+
+ B.3.3.1 Changes to FunctionDeclarationInstantiation
+
+ [...]
+ ii. If replacing the FunctionDeclaration f with a VariableStatement that
+ has F as a BindingIdentifier would not produce any Early Errors for
+ func and F is not an element of BoundNames of argumentsList, then
+ [...]
+---*/
+var init, after;
+
+(function(f = 123) {
+ init = f;
+
+ if (true) function f() { }
+
+ after = f;
+}());
+
+assert.sameValue(init, 123, 'binding is not initialized to `undefined`');
+assert.sameValue(after, 123, 'value is not updated following evaluation');
diff --git a/test/annexB/language/function-code/if-stmt-else-decl-func-skip-dft-param.js b/test/annexB/language/function-code/if-stmt-else-decl-func-skip-dft-param.js
new file mode 100644
index 000000000..869b5d08b
--- /dev/null
+++ b/test/annexB/language/function-code/if-stmt-else-decl-func-skip-dft-param.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/annex-b-fns/func-skip-dft-param.case
+// - src/annex-b-fns/func/if-stmt-else-decl.template
+/*---
+description: Extension not observed when there is a default parameter with the same name (IfStatement with a declaration in the second statement position in function scope)
+esid: sec-functiondeclarations-in-ifstatement-statement-clauses
+es6id: B.3.4
+flags: [generated, noStrict]
+info: |
+ The following rules for IfStatement augment those in 13.6:
+
+ IfStatement[Yield, Return]:
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else Statement[?Yield, ?Return]
+ if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else FunctionDeclaration[?Yield]
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else FunctionDeclaration[?Yield]
+ if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield]
+
+
+ B.3.3.1 Changes to FunctionDeclarationInstantiation
+
+ [...]
+ ii. If replacing the FunctionDeclaration f with a VariableStatement that
+ has F as a BindingIdentifier would not produce any Early Errors for
+ func and F is not an element of BoundNames of argumentsList, then
+ [...]
+---*/
+var init, after;
+
+(function(f = 123) {
+ init = f;
+
+ if (false) ; else function f() { }
+
+ after = f;
+}());
+
+assert.sameValue(init, 123, 'binding is not initialized to `undefined`');
+assert.sameValue(after, 123, 'value is not updated following evaluation');
diff --git a/test/annexB/language/function-code/switch-case-func-skip-dft-param.js b/test/annexB/language/function-code/switch-case-func-skip-dft-param.js
new file mode 100644
index 000000000..8ad5fa976
--- /dev/null
+++ b/test/annexB/language/function-code/switch-case-func-skip-dft-param.js
@@ -0,0 +1,32 @@
+// This file was procedurally generated from the following sources:
+// - src/annex-b-fns/func-skip-dft-param.case
+// - src/annex-b-fns/func/switch-case.template
+/*---
+description: Extension not observed when there is a default parameter with the same name (Function declaration in the `case` clause of a `switch` statement in function scope)
+esid: sec-web-compat-functiondeclarationinstantiation
+es6id: B.3.3.1
+flags: [generated, noStrict]
+info: |
+ B.3.3.1 Changes to FunctionDeclarationInstantiation
+
+ [...]
+ ii. If replacing the FunctionDeclaration f with a VariableStatement that
+ has F as a BindingIdentifier would not produce any Early Errors for
+ func and F is not an element of BoundNames of argumentsList, then
+ [...]
+---*/
+var init, after;
+
+(function(f = 123) {
+ init = f;
+
+ switch (1) {
+ case 1:
+ function f() { }
+ }
+
+ after = f;
+}());
+
+assert.sameValue(init, 123, 'binding is not initialized to `undefined`');
+assert.sameValue(after, 123, 'value is not updated following evaluation');
diff --git a/test/annexB/language/function-code/switch-dflt-func-skip-dft-param.js b/test/annexB/language/function-code/switch-dflt-func-skip-dft-param.js
new file mode 100644
index 000000000..d9100fefd
--- /dev/null
+++ b/test/annexB/language/function-code/switch-dflt-func-skip-dft-param.js
@@ -0,0 +1,32 @@
+// This file was procedurally generated from the following sources:
+// - src/annex-b-fns/func-skip-dft-param.case
+// - src/annex-b-fns/func/switch-dflt.template
+/*---
+description: Extension not observed when there is a default parameter with the same name (Funtion declaration in the `default` clause of a `switch` statement in function scope)
+esid: sec-web-compat-functiondeclarationinstantiation
+es6id: B.3.3.1
+flags: [generated, noStrict]
+info: |
+ B.3.3.1 Changes to FunctionDeclarationInstantiation
+
+ [...]
+ ii. If replacing the FunctionDeclaration f with a VariableStatement that
+ has F as a BindingIdentifier would not produce any Early Errors for
+ func and F is not an element of BoundNames of argumentsList, then
+ [...]
+---*/
+var init, after;
+
+(function(f = 123) {
+ init = f;
+
+ switch (1) {
+ default:
+ function f() { }
+ }
+
+ after = f;
+}());
+
+assert.sameValue(init, 123, 'binding is not initialized to `undefined`');
+assert.sameValue(after, 123, 'value is not updated following evaluation');