Debian Codegraph @

rhino/src/org/mozilla/javascript/commonjs/module/ModuleScope.java

raw symbols SCIP
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/. */
4
5 package org.mozilla.javascript.commonjs.module;
6
7 import org.mozilla.javascript.Scriptable;
8 import org.mozilla.javascript.TopLevel;
9
10 import java.net.URI;
11
12 /**
13 * A top-level module scope. This class provides methods to retrieve the
14 * module's source and base URIs in order to resolve relative module IDs
15 * and check sandbox constraints.
16 */
17 public class ModuleScope extends TopLevel {
18
19 private static final long serialVersionUID = 1L;
20
21 private final URI uri;
22 private final URI base;
23
24 public ModuleScope(Scriptable prototype, URI uri, URI base) {
25 this.uri = uri;
26 this.base = base;
27 setPrototype(prototype);
28 cacheBuiltins();
29 }
30
31 public URI getUri() {
32 return uri;
33 }
34
35 public URI getBase() {
36 return base;
37 }
38 }