1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 // Verify the environment chain for JSM described in
8 // js/src/vm/EnvironmentObject.h.
10 add_task(async function() {
11 const { envs } = ChromeUtils.import("resource://test/envChain.jsm");
13 Assert.equal(envs.length, 4);
18 Assert.equal(env.type, "NonSyntacticLexicalEnvironmentObject");
19 Assert.equal(env.qualified, false);
20 Assert.equal(env.lexical, true, "lexical must live in the NSLEO");
21 Assert.equal(env.prop, false);
24 Assert.equal(env.type, "NonSyntacticVariablesObject");
25 Assert.equal(env.qualified, true, "qualified var must live in the NSVO");
26 Assert.equal(env.lexical, false);
27 Assert.equal(env.prop, true, "prop var must live in the NSVO");
30 Assert.equal(env.type, "GlobalLexicalEnvironmentObject");
31 Assert.equal(env.qualified, false);
32 Assert.equal(env.lexical, false);
33 Assert.equal(env.prop, false);
36 Assert.equal(env.type, "*SystemGlobal*");
37 Assert.equal(env.qualified, false);
38 Assert.equal(env.lexical, false);
39 Assert.equal(env.prop, false);