JSExecutionUtils.h (1049B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef DOM_BASE_JSEXECUTIONUTILS_H_ 8 #define DOM_BASE_JSEXECUTIONUTILS_H_ 9 10 #include "js/CompileOptions.h" // JS::CompileOptions 11 #include "js/TypeDecls.h" // JSScript 12 #include "js/experimental/JSStencil.h" // JS::Stencil 13 #include "mozilla/ErrorResult.h" // ErrorResult 14 #include "nsStringFwd.h" // nsAString 15 16 namespace mozilla::dom { 17 18 nsresult EvaluationExceptionToNSResult(ErrorResult& aRv); 19 20 // Compile a script contained in a string. 21 void Compile(JSContext* aCx, JS::CompileOptions& aCompileOptions, 22 const nsAString& aScript, RefPtr<JS::Stencil>& aStencil, 23 ErrorResult& aRv); 24 25 } // namespace mozilla::dom 26 27 #endif /* DOM_BASE_JSEXECUTIONUTILS_H_ */