Bug 1835529 [wpt PR 40276] - Update wpt metadata, a=testonly
[gecko.git] / dom / chrome-webidl / PrecompiledScript.webidl
blob4a71f67fc87ea060b46c1c27981d2df50c355b68
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  */
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;
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 = {});
31   /**
32    * The URL that the script was loaded from.
33    */
34   [Pure]
35   readonly attribute DOMString url;
37   /**
38    * True if the script was compiled with a return value, and will return the
39    * value of its last expression when executed.
40    */
41   [Pure]
42   readonly attribute boolean hasReturnValue;