mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
chore: bump deno_core (#21832)
This commit is contained in:
parent
69959aa01f
commit
a45c1e4ae4
8 changed files with 31 additions and 31 deletions
16
Cargo.lock
generated
16
Cargo.lock
generated
|
@ -1151,9 +1151,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deno_core"
|
name = "deno_core"
|
||||||
version = "0.244.0"
|
version = "0.245.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7c18f86123119dffd1f2f016ff5b858b878971c042a18493794b219a33a69dda"
|
checksum = "c820d7e4712b7519dac7b03c338d0c666a77f4122aa956c630a4a888371b206e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bit-set",
|
"bit-set",
|
||||||
|
@ -1593,9 +1593,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deno_ops"
|
name = "deno_ops"
|
||||||
version = "0.120.0"
|
version = "0.121.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ed8f888f466c80fdec64d0ec2fb12b0f56b0f1ae4815bb20a1895cc7097fb775"
|
checksum = "3fe00963c45b37cc9494d134a34b72b708a8702f52024c6155958664d042ba6d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-rules",
|
"proc-macro-rules",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
@ -5274,9 +5274,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_v8"
|
name = "serde_v8"
|
||||||
version = "0.153.0"
|
version = "0.154.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0a53364678111a47806ca93b8485acd66a4a2d37da733564dcc3e76a91531ba6"
|
checksum = "3748eaed607f7dd2b5800100e5fe7c6babe9941492974d55d0bd08775f66ebbd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"derive_more",
|
"derive_more",
|
||||||
|
@ -6910,7 +6910,7 @@ dependencies = [
|
||||||
"codespan-reporting",
|
"codespan-reporting",
|
||||||
"log",
|
"log",
|
||||||
"naga",
|
"naga",
|
||||||
"parking_lot 0.12.1",
|
"parking_lot 0.11.2",
|
||||||
"profiling",
|
"profiling",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"ron",
|
"ron",
|
||||||
|
@ -6951,7 +6951,7 @@ dependencies = [
|
||||||
"naga",
|
"naga",
|
||||||
"objc",
|
"objc",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"parking_lot 0.12.1",
|
"parking_lot 0.11.2",
|
||||||
"profiling",
|
"profiling",
|
||||||
"range-alloc",
|
"range-alloc",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
|
|
|
@ -41,7 +41,7 @@ repository = "https://github.com/denoland/deno"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
deno_ast = { version = "1.0.1", features = ["transpiling"] }
|
deno_ast = { version = "1.0.1", features = ["transpiling"] }
|
||||||
deno_core = { version = "0.244.0" }
|
deno_core = { version = "0.245.0" }
|
||||||
|
|
||||||
deno_runtime = { version = "0.138.0", path = "./runtime" }
|
deno_runtime = { version = "0.138.0", path = "./runtime" }
|
||||||
napi_sym = { version = "0.60.0", path = "./cli/napi/sym" }
|
napi_sym = { version = "0.60.0", path = "./cli/napi/sym" }
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::cache::FastInsecureHasher;
|
||||||
use crate::cache::ParsedSourceCache;
|
use crate::cache::ParsedSourceCache;
|
||||||
|
|
||||||
use deno_core::error::AnyError;
|
use deno_core::error::AnyError;
|
||||||
use deno_core::ModuleCode;
|
use deno_core::ModuleCodeString;
|
||||||
use deno_core::ModuleSpecifier;
|
use deno_core::ModuleSpecifier;
|
||||||
use deno_graph::MediaType;
|
use deno_graph::MediaType;
|
||||||
use deno_graph::Module;
|
use deno_graph::Module;
|
||||||
|
@ -76,7 +76,7 @@ impl Emitter {
|
||||||
specifier: &ModuleSpecifier,
|
specifier: &ModuleSpecifier,
|
||||||
media_type: MediaType,
|
media_type: MediaType,
|
||||||
source: &Arc<str>,
|
source: &Arc<str>,
|
||||||
) -> Result<ModuleCode, AnyError> {
|
) -> Result<ModuleCodeString, AnyError> {
|
||||||
let source_hash = self.get_source_hash(source);
|
let source_hash = self.get_source_hash(source);
|
||||||
|
|
||||||
if let Some(emit_code) =
|
if let Some(emit_code) =
|
||||||
|
|
|
@ -35,7 +35,7 @@ use deno_core::futures::Future;
|
||||||
use deno_core::parking_lot::Mutex;
|
use deno_core::parking_lot::Mutex;
|
||||||
use deno_core::resolve_url;
|
use deno_core::resolve_url;
|
||||||
use deno_core::resolve_url_or_path;
|
use deno_core::resolve_url_or_path;
|
||||||
use deno_core::ModuleCode;
|
use deno_core::ModuleCodeString;
|
||||||
use deno_core::ModuleLoader;
|
use deno_core::ModuleLoader;
|
||||||
use deno_core::ModuleSource;
|
use deno_core::ModuleSource;
|
||||||
use deno_core::ModuleSourceCode;
|
use deno_core::ModuleSourceCode;
|
||||||
|
@ -264,8 +264,8 @@ impl ModuleLoadPreparer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ModuleCodeSource {
|
pub struct ModuleCodeStringSource {
|
||||||
pub code: ModuleCode,
|
pub code: ModuleCodeString,
|
||||||
pub found_url: ModuleSpecifier,
|
pub found_url: ModuleSpecifier,
|
||||||
pub media_type: MediaType,
|
pub media_type: MediaType,
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,7 @@ impl PreparedModuleLoader {
|
||||||
&self,
|
&self,
|
||||||
specifier: &ModuleSpecifier,
|
specifier: &ModuleSpecifier,
|
||||||
maybe_referrer: Option<&ModuleSpecifier>,
|
maybe_referrer: Option<&ModuleSpecifier>,
|
||||||
) -> Result<ModuleCodeSource, AnyError> {
|
) -> Result<ModuleCodeStringSource, AnyError> {
|
||||||
if specifier.scheme() == "node" {
|
if specifier.scheme() == "node" {
|
||||||
unreachable!(); // Node built-in modules should be handled internally.
|
unreachable!(); // Node built-in modules should be handled internally.
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ impl PreparedModuleLoader {
|
||||||
media_type,
|
media_type,
|
||||||
specifier,
|
specifier,
|
||||||
..
|
..
|
||||||
})) => Ok(ModuleCodeSource {
|
})) => Ok(ModuleCodeStringSource {
|
||||||
code: source.clone().into(),
|
code: source.clone().into(),
|
||||||
found_url: specifier.clone(),
|
found_url: specifier.clone(),
|
||||||
media_type: *media_type,
|
media_type: *media_type,
|
||||||
|
@ -304,7 +304,7 @@ impl PreparedModuleLoader {
|
||||||
specifier,
|
specifier,
|
||||||
..
|
..
|
||||||
})) => {
|
})) => {
|
||||||
let code: ModuleCode = match media_type {
|
let code: ModuleCodeString = match media_type {
|
||||||
MediaType::JavaScript
|
MediaType::JavaScript
|
||||||
| MediaType::Unknown
|
| MediaType::Unknown
|
||||||
| MediaType::Cjs
|
| MediaType::Cjs
|
||||||
|
@ -331,7 +331,7 @@ impl PreparedModuleLoader {
|
||||||
// at this point, we no longer need the parsed source in memory, so free it
|
// at this point, we no longer need the parsed source in memory, so free it
|
||||||
self.parsed_source_cache.free(specifier);
|
self.parsed_source_cache.free(specifier);
|
||||||
|
|
||||||
Ok(ModuleCodeSource {
|
Ok(ModuleCodeStringSource {
|
||||||
code,
|
code,
|
||||||
found_url: specifier.clone(),
|
found_url: specifier.clone(),
|
||||||
media_type: *media_type,
|
media_type: *media_type,
|
||||||
|
@ -862,7 +862,7 @@ impl NpmModuleLoader {
|
||||||
specifier: &ModuleSpecifier,
|
specifier: &ModuleSpecifier,
|
||||||
maybe_referrer: Option<&ModuleSpecifier>,
|
maybe_referrer: Option<&ModuleSpecifier>,
|
||||||
permissions: &PermissionsContainer,
|
permissions: &PermissionsContainer,
|
||||||
) -> Option<Result<ModuleCodeSource, AnyError>> {
|
) -> Option<Result<ModuleCodeStringSource, AnyError>> {
|
||||||
if self.node_resolver.in_npm_package(specifier) {
|
if self.node_resolver.in_npm_package(specifier) {
|
||||||
Some(self.load_sync(specifier, maybe_referrer, permissions))
|
Some(self.load_sync(specifier, maybe_referrer, permissions))
|
||||||
} else {
|
} else {
|
||||||
|
@ -875,7 +875,7 @@ impl NpmModuleLoader {
|
||||||
specifier: &ModuleSpecifier,
|
specifier: &ModuleSpecifier,
|
||||||
maybe_referrer: Option<&ModuleSpecifier>,
|
maybe_referrer: Option<&ModuleSpecifier>,
|
||||||
permissions: &PermissionsContainer,
|
permissions: &PermissionsContainer,
|
||||||
) -> Result<ModuleCodeSource, AnyError> {
|
) -> Result<ModuleCodeStringSource, AnyError> {
|
||||||
let file_path = specifier.to_file_path().unwrap();
|
let file_path = specifier.to_file_path().unwrap();
|
||||||
let code = self
|
let code = self
|
||||||
.fs
|
.fs
|
||||||
|
@ -923,7 +923,7 @@ impl NpmModuleLoader {
|
||||||
// esm and json code is untouched
|
// esm and json code is untouched
|
||||||
code
|
code
|
||||||
};
|
};
|
||||||
Ok(ModuleCodeSource {
|
Ok(ModuleCodeStringSource {
|
||||||
code: code.into(),
|
code: code.into(),
|
||||||
found_url: specifier.clone(),
|
found_url: specifier.clone(),
|
||||||
media_type: MediaType::from_specifier(specifier),
|
media_type: MediaType::from_specifier(specifier),
|
||||||
|
|
|
@ -23,7 +23,7 @@ use deno_core::serde_json;
|
||||||
use deno_core::sourcemap::SourceMap;
|
use deno_core::sourcemap::SourceMap;
|
||||||
use deno_core::url::Url;
|
use deno_core::url::Url;
|
||||||
use deno_core::LocalInspectorSession;
|
use deno_core::LocalInspectorSession;
|
||||||
use deno_core::ModuleCode;
|
use deno_core::ModuleCodeString;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
@ -524,7 +524,7 @@ pub async fn cover_files(
|
||||||
|
|
||||||
// Check if file was transpiled
|
// Check if file was transpiled
|
||||||
let original_source = file.source.clone();
|
let original_source = file.source.clone();
|
||||||
let transpiled_code: ModuleCode = match file.media_type {
|
let transpiled_code: ModuleCodeString = match file.media_type {
|
||||||
MediaType::JavaScript
|
MediaType::JavaScript
|
||||||
| MediaType::Unknown
|
| MediaType::Unknown
|
||||||
| MediaType::Cjs
|
| MediaType::Cjs
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use base64::prelude::BASE64_STANDARD;
|
use base64::prelude::BASE64_STANDARD;
|
||||||
use base64::Engine;
|
use base64::Engine;
|
||||||
use deno_core::ModuleCode;
|
use deno_core::ModuleCodeString;
|
||||||
use encoding_rs::*;
|
use encoding_rs::*;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::io::Error;
|
use std::io::Error;
|
||||||
|
@ -59,7 +59,7 @@ pub fn strip_bom(text: &str) -> &str {
|
||||||
static SOURCE_MAP_PREFIX: &[u8] =
|
static SOURCE_MAP_PREFIX: &[u8] =
|
||||||
b"//# sourceMappingURL=data:application/json;base64,";
|
b"//# sourceMappingURL=data:application/json;base64,";
|
||||||
|
|
||||||
pub fn source_map_from_code(code: &ModuleCode) -> Option<Vec<u8>> {
|
pub fn source_map_from_code(code: &ModuleCodeString) -> Option<Vec<u8>> {
|
||||||
let bytes = code.as_bytes();
|
let bytes = code.as_bytes();
|
||||||
let last_line = bytes.rsplit(|u| *u == b'\n').next()?;
|
let last_line = bytes.rsplit(|u| *u == b'\n').next()?;
|
||||||
if last_line.starts_with(SOURCE_MAP_PREFIX) {
|
if last_line.starts_with(SOURCE_MAP_PREFIX) {
|
||||||
|
@ -74,7 +74,7 @@ pub fn source_map_from_code(code: &ModuleCode) -> Option<Vec<u8>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Truncate the source code before the source map.
|
/// Truncate the source code before the source map.
|
||||||
pub fn code_without_source_map(mut code: ModuleCode) -> ModuleCode {
|
pub fn code_without_source_map(mut code: ModuleCodeString) -> ModuleCodeString {
|
||||||
let bytes = code.as_bytes();
|
let bytes = code.as_bytes();
|
||||||
for i in (0..bytes.len()).rev() {
|
for i in (0..bytes.len()).rev() {
|
||||||
if bytes[i] == b'\n' {
|
if bytes[i] == b'\n' {
|
||||||
|
@ -163,7 +163,7 @@ mod tests {
|
||||||
|
|
||||||
fn run_test(input: &'static str, output: &'static str) {
|
fn run_test(input: &'static str, output: &'static str) {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
code_without_source_map(ModuleCode::from_static(input))
|
code_without_source_map(ModuleCodeString::from_static(input))
|
||||||
.as_str()
|
.as_str()
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
output
|
output
|
||||||
|
|
|
@ -29,7 +29,7 @@ use deno_core::Extension;
|
||||||
use deno_core::FeatureChecker;
|
use deno_core::FeatureChecker;
|
||||||
use deno_core::GetErrorClassFn;
|
use deno_core::GetErrorClassFn;
|
||||||
use deno_core::JsRuntime;
|
use deno_core::JsRuntime;
|
||||||
use deno_core::ModuleCode;
|
use deno_core::ModuleCodeString;
|
||||||
use deno_core::ModuleId;
|
use deno_core::ModuleId;
|
||||||
use deno_core::ModuleLoader;
|
use deno_core::ModuleLoader;
|
||||||
use deno_core::ModuleSpecifier;
|
use deno_core::ModuleSpecifier;
|
||||||
|
@ -649,7 +649,7 @@ impl WebWorker {
|
||||||
pub fn execute_script(
|
pub fn execute_script(
|
||||||
&mut self,
|
&mut self,
|
||||||
name: &'static str,
|
name: &'static str,
|
||||||
source_code: ModuleCode,
|
source_code: ModuleCodeString,
|
||||||
) -> Result<(), AnyError> {
|
) -> Result<(), AnyError> {
|
||||||
self.js_runtime.execute_script(name, source_code)?;
|
self.js_runtime.execute_script(name, source_code)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -22,7 +22,7 @@ use deno_core::FsModuleLoader;
|
||||||
use deno_core::GetErrorClassFn;
|
use deno_core::GetErrorClassFn;
|
||||||
use deno_core::JsRuntime;
|
use deno_core::JsRuntime;
|
||||||
use deno_core::LocalInspectorSession;
|
use deno_core::LocalInspectorSession;
|
||||||
use deno_core::ModuleCode;
|
use deno_core::ModuleCodeString;
|
||||||
use deno_core::ModuleId;
|
use deno_core::ModuleId;
|
||||||
use deno_core::ModuleLoader;
|
use deno_core::ModuleLoader;
|
||||||
use deno_core::ModuleSpecifier;
|
use deno_core::ModuleSpecifier;
|
||||||
|
@ -537,7 +537,7 @@ impl MainWorker {
|
||||||
pub fn execute_script(
|
pub fn execute_script(
|
||||||
&mut self,
|
&mut self,
|
||||||
script_name: &'static str,
|
script_name: &'static str,
|
||||||
source_code: ModuleCode,
|
source_code: ModuleCodeString,
|
||||||
) -> Result<v8::Global<v8::Value>, AnyError> {
|
) -> Result<v8::Global<v8::Value>, AnyError> {
|
||||||
self.js_runtime.execute_script(script_name, source_code)
|
self.js_runtime.execute_script(script_name, source_code)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue