summaryrefslogtreecommitdiff
path: root/core/runtime.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-05-05 13:16:25 +0200
committerGitHub <noreply@github.com>2022-05-05 13:16:25 +0200
commit45a4d75296b221240a2842bae0aef21622e21f97 (patch)
treea0af348a54099f9dd2b2be34c1e071375bc99d6d /core/runtime.rs
parent242273e69b5f5add23393e8e96e241696eae88fb (diff)
refactor(core): use Box<u8> for ModuleSource.code instead of a String (#14487)
Diffstat (limited to 'core/runtime.rs')
-rw-r--r--core/runtime.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/runtime.rs b/core/runtime.rs
index 865995f74..f589ad25b 100644
--- a/core/runtime.rs
+++ b/core/runtime.rs
@@ -1554,7 +1554,7 @@ impl JsRuntime {
// main module
true,
specifier.as_str(),
- &code,
+ code.as_bytes(),
)
.map_err(|e| match e {
ModuleError::Exception(exception) => {
@@ -1613,7 +1613,7 @@ impl JsRuntime {
// not main module
false,
specifier.as_str(),
- &code,
+ code.as_bytes(),
)
.map_err(|e| match e {
ModuleError::Exception(exception) => {
@@ -3022,7 +3022,7 @@ assertEquals(1, notify_return_value);
) -> Pin<Box<ModuleSourceFuture>> {
async move {
Ok(ModuleSource {
- code: "console.log('hello world');".to_string(),
+ code: b"console.log('hello world');".to_vec().into_boxed_slice(),
module_url_specified: "file:///main.js".to_string(),
module_url_found: "file:///main.js".to_string(),
module_type: ModuleType::JavaScript,