summaryrefslogtreecommitdiff
path: root/cli/global_state.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-05-02 00:32:05 +0200
committerGitHub <noreply@github.com>2020-05-02 00:32:05 +0200
commitde2c042482741dc23f7d975458a1fba95863de53 (patch)
treed9cb99d069a450ce708952b980ae15857b86a5d9 /cli/global_state.rs
parent96fd0f4692126516239d61784caf6599aa884844 (diff)
BREAKING: remove support for JSON imports (#5037)
This commit removes support for importing JSON files as modules. This change is dictated by security; browsers rolled back on this support as well.
Diffstat (limited to 'cli/global_state.rs')
-rw-r--r--cli/global_state.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/cli/global_state.rs b/cli/global_state.rs
index c9383bd88..cee105d4d 100644
--- a/cli/global_state.rs
+++ b/cli/global_state.rs
@@ -1,7 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use crate::compilers::CompiledModule;
use crate::compilers::JsCompiler;
-use crate::compilers::JsonCompiler;
use crate::compilers::TargetLib;
use crate::compilers::TsCompiler;
use crate::compilers::WasmCompiler;
@@ -36,7 +35,6 @@ pub struct GlobalStateInner {
pub dir: deno_dir::DenoDir,
pub file_fetcher: SourceFileFetcher,
pub js_compiler: JsCompiler,
- pub json_compiler: JsonCompiler,
pub ts_compiler: TsCompiler,
pub wasm_compiler: WasmCompiler,
pub lockfile: Option<Mutex<Lockfile>>,
@@ -88,7 +86,6 @@ impl GlobalState {
file_fetcher,
ts_compiler,
js_compiler: JsCompiler {},
- json_compiler: JsonCompiler {},
wasm_compiler: WasmCompiler::default(),
lockfile,
compiler_starts: AtomicUsize::new(0),
@@ -118,8 +115,9 @@ impl GlobalState {
let compile_lock = self.compile_lock.lock().await;
let compiled_module = match out.media_type {
- msg::MediaType::Unknown => state1.js_compiler.compile(out).await,
- msg::MediaType::Json => state1.json_compiler.compile(&out).await,
+ msg::MediaType::Json | msg::MediaType::Unknown => {
+ state1.js_compiler.compile(out).await
+ }
msg::MediaType::Wasm => {
state1.wasm_compiler.compile(state1.clone(), &out).await
}