mirror of
https://github.com/tc39/test262.git
synced 2025-11-08 15:59:43 +01:00
* Add tests for prototype realm inference * Add tests for miscellaneous realm concerns * Add tests for realm of spec-created Errors In some cases, Error objects produced by the specification are observable from ECMAScript code. Among these cases, some are further differentiated in that they occur outside of any built-in function and may be triggered through syntactic production directly. The current realm record is commonly interpreted incorrectly under these circumstances. Add tests asserting that the expected realm record is used when constructing such Error objects. * Add tests for realm use in ArraySpeciesCreate * Add tests for function realm retrieval * Add tests for cross-realm behaviors of Symbols * Add tests for GetValue and PutValue * Add tests for realm of spec-created Arrays In some cases, Arrays produced by CreateArrayFromList are observable from ECMAScript code. Among these cases, two occur outside of any built-in function and may be triggered through syntactic production directly. The current realm record is commonly interpreted incorrectly under these circumstances. Add tests asserting that the expected realm record is used when constructing arrays. * Add test for spec-created object * fixup! Add tests for realm of spec-created Errors * fixup! Add tests for realm of spec-created Errors * fixup! Add tests for prototype realm inference * fixup! Add tests for miscellaneous realm concerns
31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
/*---
|
|
esid: sec-ecmascript-function-objects-call-thisargument-argumentslist
|
|
es6id: 9.2.1
|
|
description: The "this" value is set to the global This value
|
|
info: >
|
|
[...]
|
|
6. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument).
|
|
[...]
|
|
|
|
9.2.1.2OrdinaryCallBindThis ( F, calleeContext, thisArgument )#
|
|
|
|
[...]
|
|
5. If thisMode is strict, let thisValue be thisArgument.
|
|
6. Else,
|
|
a. If thisArgument is null or undefined, then
|
|
i. Let globalEnv be calleeRealm.[[GlobalEnv]].
|
|
ii. Let globalEnvRec be globalEnv's EnvironmentRecord.
|
|
iii. Let thisValue be globalEnvRec.[[GlobalThisValue]].
|
|
[...]
|
|
---*/
|
|
|
|
var other = $.createRealm().global;
|
|
var func = new other.Function('return this;');
|
|
var subject;
|
|
|
|
assert.sameValue(func(), other, 'implicit undefined');
|
|
assert.sameValue(func.call(undefined), other, 'explicit undefined');
|
|
assert.sameValue(func.call(null), other, 'null');
|