Debian Codegraph @

js/src/tests/test262/harness/wellKnownIntrinsicObjects.js

raw
1 // Copyright (C) 2025 Igalia, S.L. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: Basic tests for getWellKnownIntrinsicObject harness function
6 includes: [wellKnownIntrinsicObjects.js]
7 ---*/
8
9 // Accessible in every implementation
10 var intrinsicArray = getWellKnownIntrinsicObject('%Array%');
11 assert(Object.is(Array, intrinsicArray));
12
13 assert.throws(Test262Error, function () {
14 // Exists but is not accessible in any implementation
15 getWellKnownIntrinsicObject('%AsyncFromSyncIteratorPrototype%');
16 });
17
18 assert.throws(Test262Error, function () {
19 // Does not exist in any implementation
20 getWellKnownIntrinsicObject('%NotSoWellKnownIntrinsicObject%');
21 });
22
23 reportCompare(0, 0);