mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Define const for inlineScript
Signed-off-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
parent
a8574fcbd5
commit
15069b21ff
3 changed files with 11 additions and 5 deletions
|
@ -81,7 +81,7 @@ use crate::script_module::{
|
||||||
ImportMap, ModuleOwner, ScriptFetchOptions, fetch_external_module_script,
|
ImportMap, ModuleOwner, ScriptFetchOptions, fetch_external_module_script,
|
||||||
fetch_inline_module_script, parse_an_import_map_string, register_import_map,
|
fetch_inline_module_script, parse_an_import_map_string, register_import_map,
|
||||||
};
|
};
|
||||||
use crate::script_runtime::CanGc;
|
use crate::script_runtime::{CanGc, IntroductionType};
|
||||||
use crate::task_source::{SendableTaskSource, TaskSourceName};
|
use crate::task_source::{SendableTaskSource, TaskSourceName};
|
||||||
use crate::unminify::{ScriptSource, unminify_js};
|
use crate::unminify::{ScriptSource, unminify_js};
|
||||||
|
|
||||||
|
@ -1146,7 +1146,7 @@ impl HTMLScriptElement {
|
||||||
// Step 6.
|
// Step 6.
|
||||||
let document = self.owner_document();
|
let document = self.owner_document();
|
||||||
let old_script = document.GetCurrentScript();
|
let old_script = document.GetCurrentScript();
|
||||||
let introduction_type = (!script.external).then_some(c"inlineScript");
|
let introduction_type = (!script.external).then_some(IntroductionType::INLINE_SCRIPT);
|
||||||
|
|
||||||
match script.type_ {
|
match script.type_ {
|
||||||
ScriptType::Classic => {
|
ScriptType::Classic => {
|
||||||
|
|
|
@ -78,7 +78,7 @@ use crate::dom::window::Window;
|
||||||
use crate::dom::worker::TrustedWorkerAddress;
|
use crate::dom::worker::TrustedWorkerAddress;
|
||||||
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
||||||
use crate::realms::{AlreadyInRealm, InRealm, enter_realm};
|
use crate::realms::{AlreadyInRealm, InRealm, enter_realm};
|
||||||
use crate::script_runtime::{CanGc, JSContext as SafeJSContext};
|
use crate::script_runtime::{CanGc, IntroductionType, JSContext as SafeJSContext};
|
||||||
use crate::task::TaskBox;
|
use crate::task::TaskBox;
|
||||||
|
|
||||||
fn gen_type_error(global: &GlobalScope, string: String, can_gc: CanGc) -> RethrowError {
|
fn gen_type_error(global: &GlobalScope, string: String, can_gc: CanGc) -> RethrowError {
|
||||||
|
@ -1901,7 +1901,7 @@ pub(crate) fn fetch_inline_module_script(
|
||||||
compiled_module.handle_mut(),
|
compiled_module.handle_mut(),
|
||||||
true,
|
true,
|
||||||
can_gc,
|
can_gc,
|
||||||
Some(c"inlineScript"),
|
Some(IntroductionType::INLINE_SCRIPT),
|
||||||
);
|
);
|
||||||
|
|
||||||
match compiled_module_result {
|
match compiled_module_result {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
use core::ffi::c_char;
|
use core::ffi::c_char;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use std::ffi::CString;
|
use std::ffi::{CStr, CString};
|
||||||
use std::io::{Write, stdout};
|
use std::io::{Write, stdout};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::os::raw::c_void;
|
use std::os::raw::c_void;
|
||||||
|
@ -1194,3 +1194,9 @@ impl Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) use script_bindings::script_runtime::CanGc;
|
pub(crate) use script_bindings::script_runtime::CanGc;
|
||||||
|
|
||||||
|
/// `introductionType` values in SpiderMonkey TransitiveCompileOptions.
|
||||||
|
pub(crate) struct IntroductionType;
|
||||||
|
impl IntroductionType {
|
||||||
|
pub const INLINE_SCRIPT: &'static CStr = c"inlineScript";
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue