PrecompiledScript.webidl (1601B)
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 dictionary ExecuteInGlobalOptions { 8 /** 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. 13 */ 14 boolean reportExceptions = false; 15 }; 16 17 /** 18 * Represents a pre-compiled JS script, which can be repeatedly executed in 19 * different globals without being re-parsed. 20 */ 21 [ChromeOnly, Exposed=Window] 22 interface PrecompiledScript { 23 /** 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. 27 */ 28 [Throws] 29 any executeInGlobal(object global, optional ExecuteInGlobalOptions options = {}); 30 31 /** 32 * The URL that the script was loaded from. Could also be an arbitrary other 33 * value as specified by the "filename" option to ChromeUtils.compileScript. 34 */ 35 [Pure] 36 readonly attribute DOMString url; 37 38 /** 39 * True if the script was compiled with a return value, and will return the 40 * value of its last expression when executed. 41 */ 42 [Pure] 43 readonly attribute boolean hasReturnValue; 44 };