1
0
Fork 0
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:
Matt Mastracci 2024-01-09 21:18:40 -07:00 committed by GitHub
parent 69959aa01f
commit a45c1e4ae4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 31 deletions

16
Cargo.lock generated
View file

@ -1151,9 +1151,9 @@ dependencies = [
[[package]]
name = "deno_core"
version = "0.244.0"
version = "0.245.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c18f86123119dffd1f2f016ff5b858b878971c042a18493794b219a33a69dda"
checksum = "c820d7e4712b7519dac7b03c338d0c666a77f4122aa956c630a4a888371b206e"
dependencies = [
"anyhow",
"bit-set",
@ -1593,9 +1593,9 @@ dependencies = [
[[package]]
name = "deno_ops"
version = "0.120.0"
version = "0.121.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed8f888f466c80fdec64d0ec2fb12b0f56b0f1ae4815bb20a1895cc7097fb775"
checksum = "3fe00963c45b37cc9494d134a34b72b708a8702f52024c6155958664d042ba6d"
dependencies = [
"proc-macro-rules",
"proc-macro2",
@ -5274,9 +5274,9 @@ dependencies = [
[[package]]
name = "serde_v8"
version = "0.153.0"
version = "0.154.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a53364678111a47806ca93b8485acd66a4a2d37da733564dcc3e76a91531ba6"
checksum = "3748eaed607f7dd2b5800100e5fe7c6babe9941492974d55d0bd08775f66ebbd"
dependencies = [
"bytes",
"derive_more",
@ -6910,7 +6910,7 @@ dependencies = [
"codespan-reporting",
"log",
"naga",
"parking_lot 0.12.1",
"parking_lot 0.11.2",
"profiling",
"raw-window-handle",
"ron",
@ -6951,7 +6951,7 @@ dependencies = [
"naga",
"objc",
"once_cell",
"parking_lot 0.12.1",
"parking_lot 0.11.2",
"profiling",
"range-alloc",
"raw-window-handle",

View file

@ -41,7 +41,7 @@ repository = "https://github.com/denoland/deno"
[workspace.dependencies]
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" }
napi_sym = { version = "0.60.0", path = "./cli/napi/sym" }

View file

@ -5,7 +5,7 @@ use crate::cache::FastInsecureHasher;
use crate::cache::ParsedSourceCache;
use deno_core::error::AnyError;
use deno_core::ModuleCode;
use deno_core::ModuleCodeString;
use deno_core::ModuleSpecifier;
use deno_graph::MediaType;
use deno_graph::Module;
@ -76,7 +76,7 @@ impl Emitter {
specifier: &ModuleSpecifier,
media_type: MediaType,
source: &Arc<str>,
) -> Result<ModuleCode, AnyError> {
) -> Result<ModuleCodeString, AnyError> {
let source_hash = self.get_source_hash(source);
if let Some(emit_code) =

View file

@ -35,7 +35,7 @@ use deno_core::futures::Future;
use deno_core::parking_lot::Mutex;
use deno_core::resolve_url;
use deno_core::resolve_url_or_path;
use deno_core::ModuleCode;
use deno_core::ModuleCodeString;
use deno_core::ModuleLoader;
use deno_core::ModuleSource;
use deno_core::ModuleSourceCode;
@ -264,8 +264,8 @@ impl ModuleLoadPreparer {
}
}
pub struct ModuleCodeSource {
pub code: ModuleCode,
pub struct ModuleCodeStringSource {
pub code: ModuleCodeString,
pub found_url: ModuleSpecifier,
pub media_type: MediaType,
}
@ -281,7 +281,7 @@ impl PreparedModuleLoader {
&self,
specifier: &ModuleSpecifier,
maybe_referrer: Option<&ModuleSpecifier>,
) -> Result<ModuleCodeSource, AnyError> {
) -> Result<ModuleCodeStringSource, AnyError> {
if specifier.scheme() == "node" {
unreachable!(); // Node built-in modules should be handled internally.
}
@ -293,7 +293,7 @@ impl PreparedModuleLoader {
media_type,
specifier,
..
})) => Ok(ModuleCodeSource {
})) => Ok(ModuleCodeStringSource {
code: source.clone().into(),
found_url: specifier.clone(),
media_type: *media_type,
@ -304,7 +304,7 @@ impl PreparedModuleLoader {
specifier,
..
})) => {
let code: ModuleCode = match media_type {
let code: ModuleCodeString = match media_type {
MediaType::JavaScript
| MediaType::Unknown
| MediaType::Cjs
@ -331,7 +331,7 @@ impl PreparedModuleLoader {
// at this point, we no longer need the parsed source in memory, so free it
self.parsed_source_cache.free(specifier);
Ok(ModuleCodeSource {
Ok(ModuleCodeStringSource {
code,
found_url: specifier.clone(),
media_type: *media_type,
@ -862,7 +862,7 @@ impl NpmModuleLoader {
specifier: &ModuleSpecifier,
maybe_referrer: Option<&ModuleSpecifier>,
permissions: &PermissionsContainer,
) -> Option<Result<ModuleCodeSource, AnyError>> {
) -> Option<Result<ModuleCodeStringSource, AnyError>> {
if self.node_resolver.in_npm_package(specifier) {
Some(self.load_sync(specifier, maybe_referrer, permissions))
} else {
@ -875,7 +875,7 @@ impl NpmModuleLoader {
specifier: &ModuleSpecifier,
maybe_referrer: Option<&ModuleSpecifier>,
permissions: &PermissionsContainer,
) -> Result<ModuleCodeSource, AnyError> {
) -> Result<ModuleCodeStringSource, AnyError> {
let file_path = specifier.to_file_path().unwrap();
let code = self
.fs
@ -923,7 +923,7 @@ impl NpmModuleLoader {
// esm and json code is untouched
code
};
Ok(ModuleCodeSource {
Ok(ModuleCodeStringSource {
code: code.into(),
found_url: specifier.clone(),
media_type: MediaType::from_specifier(specifier),

View file

@ -23,7 +23,7 @@ use deno_core::serde_json;
use deno_core::sourcemap::SourceMap;
use deno_core::url::Url;
use deno_core::LocalInspectorSession;
use deno_core::ModuleCode;
use deno_core::ModuleCodeString;
use regex::Regex;
use std::fs;
use std::fs::File;
@ -524,7 +524,7 @@ pub async fn cover_files(
// Check if file was transpiled
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::Unknown
| MediaType::Cjs

View file

@ -2,7 +2,7 @@
use base64::prelude::BASE64_STANDARD;
use base64::Engine;
use deno_core::ModuleCode;
use deno_core::ModuleCodeString;
use encoding_rs::*;
use std::borrow::Cow;
use std::io::Error;
@ -59,7 +59,7 @@ pub fn strip_bom(text: &str) -> &str {
static SOURCE_MAP_PREFIX: &[u8] =
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 last_line = bytes.rsplit(|u| *u == b'\n').next()?;
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.
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();
for i in (0..bytes.len()).rev() {
if bytes[i] == b'\n' {
@ -163,7 +163,7 @@ mod tests {
fn run_test(input: &'static str, output: &'static str) {
assert_eq!(
code_without_source_map(ModuleCode::from_static(input))
code_without_source_map(ModuleCodeString::from_static(input))
.as_str()
.to_owned(),
output

View file

@ -29,7 +29,7 @@ use deno_core::Extension;
use deno_core::FeatureChecker;
use deno_core::GetErrorClassFn;
use deno_core::JsRuntime;
use deno_core::ModuleCode;
use deno_core::ModuleCodeString;
use deno_core::ModuleId;
use deno_core::ModuleLoader;
use deno_core::ModuleSpecifier;
@ -649,7 +649,7 @@ impl WebWorker {
pub fn execute_script(
&mut self,
name: &'static str,
source_code: ModuleCode,
source_code: ModuleCodeString,
) -> Result<(), AnyError> {
self.js_runtime.execute_script(name, source_code)?;
Ok(())

View file

@ -22,7 +22,7 @@ use deno_core::FsModuleLoader;
use deno_core::GetErrorClassFn;
use deno_core::JsRuntime;
use deno_core::LocalInspectorSession;
use deno_core::ModuleCode;
use deno_core::ModuleCodeString;
use deno_core::ModuleId;
use deno_core::ModuleLoader;
use deno_core::ModuleSpecifier;
@ -537,7 +537,7 @@ impl MainWorker {
pub fn execute_script(
&mut self,
script_name: &'static str,
source_code: ModuleCode,
source_code: ModuleCodeString,
) -> Result<v8::Global<v8::Value>, AnyError> {
self.js_runtime.execute_script(script_name, source_code)
}