From 0618779cb832892b7d338b05bdff00dc1079bc51 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Sun, 10 Jun 2018 19:07:05 -0400 Subject: [PATCH] Normalize coverage Promote consistency in coverage by adding new tests that correspond to those that were authored previously. --- .../func-decl-no-semi-runtime.js | 20 +++++++++++++++ .../directive-prologue/set-accsr-runtime.js | 25 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 test/language/directive-prologue/func-decl-no-semi-runtime.js create mode 100644 test/language/directive-prologue/set-accsr-runtime.js diff --git a/test/language/directive-prologue/func-decl-no-semi-runtime.js b/test/language/directive-prologue/func-decl-no-semi-runtime.js new file mode 100644 index 0000000000..7134fa6217 --- /dev/null +++ b/test/language/directive-prologue/func-decl-no-semi-runtime.js @@ -0,0 +1,20 @@ +// Copyright (c) 2012 Ecma International. 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 ';' +flags: [noStrict] +---*/ + +function fun() { + "use strict" + eval("var public = 1;"); +} + +assert.throws(SyntaxError, function() { + fun(); +}); diff --git a/test/language/directive-prologue/set-accsr-runtime.js b/test/language/directive-prologue/set-accsr-runtime.js new file mode 100644 index 0000000000..ea2a325867 --- /dev/null +++ b/test/language/directive-prologue/set-accsr-runtime.js @@ -0,0 +1,25 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: use-strict-directive +es5id: 10.1.1-25-s +description: > + Strict Mode - Function code of Accessor PropertyAssignment + contains Use Strict Directive which appears at the start of the + block(getter) +flags: [noStrict] +---*/ + + +assert.throws(SyntaxError, function() { + var obj = {}; + Object.defineProperty(obj, "accProperty", { + set: function () { + "use strict"; + eval("var public = 1;"); + return 11; + } + }); + obj.accProperty = "overrideData"; +});