Coverage: formal parameter binding identifier "eval" must have the correct value in non-strict code. Fixes gh-2814

This commit is contained in:
Rick Waldron 2020-09-23 11:15:46 -04:00
parent 16bf949629
commit e2a4e79a11
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,21 @@
// Copyright (c) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-strict-mode-of-ecmascript
description: >
eval allowed as formal parameter name of a non-strict function expression
flags: [noStrict]
---*/
let exprCallCount = 0;
let evalValue = {};
let foo = function(eval) {
assert.sameValue(eval, evalValue);
exprCallCount += 1;
};
foo(evalValue);
assert.sameValue(exprCallCount, 1);

View File

@ -0,0 +1,21 @@
// Copyright (c) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-strict-mode-of-ecmascript
description: >
eval allowed as formal parameter name of a non-strict function declaration
flags: [noStrict]
---*/
let exprCallCount = 0;
let evalValue = {};
function foo(eval) {
assert.sameValue(eval, evalValue);
exprCallCount += 1;
}
foo(evalValue);
assert.sameValue(exprCallCount, 1);