1/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
5 */
6
7/**
8 * Represents a pre-compiled JS script, which can be repeatedly executed in
9 * different globals without being re-parsed.
10 */
11[ChromeOnly, Exposed=Window]
12interface PrecompiledScript {
13  /**
14   * Executes the script in the context of, and with the security principal
15   * of, the given object's global. If compiled with a return value, returns
16   * the value of the script's last expression. Otherwise returns undefined.
17   */
18  [Throws]
19  any executeInGlobal(object global);
20
21  /**
22   * The URL that the script was loaded from.
23   */
24  [Pure]
25  readonly attribute DOMString url;
26
27  /**
28   * True if the script was compiled with a return value, and will return the
29   * value of its last expression when executed.
30   */
31  [Pure]
32  readonly attribute boolean hasReturnValue;
33};
34