test262/test/language/expressions/function/forbidden-ext/b2/func-expr-forbidden-ext-ind...

30 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-09-18 22:13:48 +02:00
// This file was procedurally generated from the following sources:
// - src/function-forms/forbidden-ext-indirect-access-prop-caller.case
// - src/function-forms/forbidden-extensions/bullet-two/func-expr.template
/*---
description: Forbidden extension, o.caller (function expression)
esid: sec-definitions-runtime-semantics-evaluation
flags: [generated, noStrict]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
If an implementation extends any function object with an own property named "caller" the value of that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function object. If it is an accessor property, the function that is the value of the property's [[Get]] attribute must never return a strict function when called.
---*/
function inner() {
// This property is forbidden from having a value that is strict function object
return inner.caller;
}
var callCount = 0;
var f;
f = function() {
"use strict";
inner().toString();
2020-09-25 17:23:33 +02:00
callCount++;
2020-09-18 22:13:48 +02:00
};
assert.throws(TypeError, function() {
f();
});
assert.sameValue(callCount, 0, 'method body not evaluated');