diff --git a/test/language/directive-prologue/func-decl-inside-func-decl-parse.js b/test/language/directive-prologue/func-decl-inside-func-decl-parse.js new file mode 100644 index 0000000000000000000000000000000000000000..d540118e43021e3443811f109abfd98a5da992a0 --- /dev/null +++ b/test/language/directive-prologue/func-decl-inside-func-decl-parse.js @@ -0,0 +1,22 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-15-s +description: > + Strict Mode - Function code that is part of a FunctionDeclaration + is strict function code if FunctionDeclaration is contained in use + strict +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +function testcase() { + "use strict"; + function fun() { + var static; + } +} diff --git a/test/language/directive-prologue/func-decl-no-semi-parse.js b/test/language/directive-prologue/func-decl-no-semi-parse.js new file mode 100644 index 0000000000000000000000000000000000000000..9135ff4b911111044cb3f44ed56110063b252f4d --- /dev/null +++ b/test/language/directive-prologue/func-decl-no-semi-parse.js @@ -0,0 +1,19 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-2-s +description: > + Strict Mode - Use Strict Directive Prologue is ''use strict'' + which lost the last character ';' +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +function fun() { + "use strict" + var static; +} diff --git a/test/language/directive-prologue/func-decl-parse.js b/test/language/directive-prologue/func-decl-parse.js new file mode 100644 index 0000000000000000000000000000000000000000..2740f3546eb5d041a86feab99da6dd1532dcd258 --- /dev/null +++ b/test/language/directive-prologue/func-decl-parse.js @@ -0,0 +1,19 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-19-s +description: > + Strict Mode - Function code of a FunctionDeclaration contains Use + Strict Directive which appears at the start of the block +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +function fun() { + "use strict"; + var static; +} diff --git a/test/language/directive-prologue/func-expr-inside-func-decl-parse.js b/test/language/directive-prologue/func-expr-inside-func-decl-parse.js new file mode 100644 index 0000000000000000000000000000000000000000..22e48b2a1f6ae4a6faf05ef0788df76f5a7daa6c --- /dev/null +++ b/test/language/directive-prologue/func-expr-inside-func-decl-parse.js @@ -0,0 +1,20 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-16-s +description: > + Strict Mode - Function code that is part of a FunctionExpression + is strict function code if FunctionExpression is contained in use + strict +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +function testcase() { + "use strict"; + var static; +} diff --git a/test/language/directive-prologue/func-expr-no-semi-parse.js b/test/language/directive-prologue/func-expr-no-semi-parse.js new file mode 100644 index 0000000000000000000000000000000000000000..404e1ac3088afe1eacdb0e0d46e3a9d3547f0717 --- /dev/null +++ b/test/language/directive-prologue/func-expr-no-semi-parse.js @@ -0,0 +1,20 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-2-s +description: > + Strict Mode - Use Strict Directive Prologue is ''use strict'' + which lost the last character ';' +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +(function() { + "use strict" + + var static; +}); diff --git a/test/language/directive-prologue/func-expr-parse.js b/test/language/directive-prologue/func-expr-parse.js new file mode 100644 index 0000000000000000000000000000000000000000..b1239d2d49cf785a2bacbaa714c6cd50f15f23be --- /dev/null +++ b/test/language/directive-prologue/func-expr-parse.js @@ -0,0 +1,20 @@ +// Copyright (c) 2018 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-22-s +description: > + Strict Mode - Function code of a FunctionExpression contains Use + Strict Directive which appears at the start of the block +negative: + phase: early + type: SyntaxError +flags: [noStrict] +---*/ + +(function() { + "use strict"; + + var static; +});