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/.
7 dictionary ExecuteInGlobalOptions {
9 * If `reportExceptions` is set to true and any exception happens
10 * while executing the script, the exceptions will automatically be logged
11 * in the console. This helps log the exception with the right global innerWindowID
12 * and make it display in the right DevTools console.
14 boolean reportExceptions = false;
18 * Represents a pre-compiled JS script, which can be repeatedly executed in
19 * different globals without being re-parsed.
21 [ChromeOnly, Exposed=Window]
22 interface PrecompiledScript {
24 * Executes the script in the context of, and with the security principal
25 * of, the given object's global. If compiled with a return value, returns
26 * the value of the script's last expression. Otherwise returns undefined.
29 any executeInGlobal(object global, optional ExecuteInGlobalOptions options = {});
32 * The URL that the script was loaded from.
35 readonly attribute DOMString url;
38 * True if the script was compiled with a return value, and will return the
39 * value of its last expression when executed.
42 readonly attribute boolean hasReturnValue;