Backed out changeset 713114c0331a (bug 1938707) by developer request CLOSED TREE
[gecko.git] / js / xpconnect / tests / unit / envChain_subscript.jsm
blob221b2b6c53ea1e16ef20148c93c1dfbf3e563a02
1 const target = {};
2 Services.scriptloader.loadSubScript(`data:,
3 var qualified = 10;
4 unqualified = 20;
5 let lexical = 30;
6 this.prop = 40;
8 const funcs = Cu.getJSTestingFunctions();
9 const envs = [];
10 let env = funcs.getInnerMostEnvironmentObject();
11 while (env) {
12   envs.push({
13     type: funcs.getEnvironmentObjectType(env) || "*SystemGlobal*",
14     qualified: !!Object.getOwnPropertyDescriptor(env, "qualified"),
15     unqualified: !!Object.getOwnPropertyDescriptor(env, "unqualified"),
16     lexical: !!Object.getOwnPropertyDescriptor(env, "lexical"),
17     prop: !!Object.getOwnPropertyDescriptor(env, "prop"),
18   });
20   env = funcs.getEnclosingEnvironmentObject(env);
23 this.ENVS = envs;
24 `, target);
26 const envs = target.ENVS;
27 const EXPORTED_SYMBOLS = ["envs"];