mirror of
https://github.com/tc39/test262.git
synced 2025-11-07 23:39:43 +01:00
The `negative` frontmatter tag expresses an expectation for the behavior of the test file as a whole. The `assert.throws` helper function offers more fine-grained control over expectations because it may be applied to specific statements and expressions. This makes it preferable in cases where it may be used (i.e. when the test body does not describe a syntax error or early error). Re-implement assertions for errors to use the `assert.throws` helper function wherever possible.
20 lines
620 B
JavaScript
20 lines
620 B
JavaScript
// Copyright (c) 2012 Ecma International. All rights reserved.
|
|
// Ecma International makes this code available under the terms and conditions set
|
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
|
// "Use Terms"). Any redistribution of this code must retain the above
|
|
// copyright and this notice and otherwise comply with the Use Terms.
|
|
|
|
/*---
|
|
es5id: 15.3.5-2gs
|
|
description: >
|
|
StrictMode - error is thrown when reading the 'caller' property of
|
|
a function object
|
|
flags: [onlyStrict]
|
|
---*/
|
|
|
|
function _15_3_5_1_gs() {}
|
|
|
|
assert.throws(TypeError, function() {
|
|
_15_3_5_1_gs.caller;
|
|
});
|