0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 17:34:47 -05:00

fix(fmt): prevent infinite loop when formatting certain binary expressions (#14725)

This commit is contained in:
David Sherret 2022-05-25 19:55:31 -04:00 committed by GitHub
parent 3aef7d1253
commit b4fabedd79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 20 deletions

View file

@ -45,9 +45,9 @@
"tools/wpt/manifest.json" "tools/wpt/manifest.json"
], ],
"plugins": [ "plugins": [
"https://plugins.dprint.dev/typescript-0.68.2.wasm", "https://plugins.dprint.dev/typescript-0.68.4.wasm",
"https://plugins.dprint.dev/json-0.15.2.wasm", "https://plugins.dprint.dev/json-0.15.3.wasm",
"https://plugins.dprint.dev/markdown-0.13.2.wasm", "https://plugins.dprint.dev/markdown-0.13.3.wasm",
"https://plugins.dprint.dev/toml-0.5.4.wasm", "https://plugins.dprint.dev/toml-0.5.4.wasm",
"https://plugins.dprint.dev/exec-0.2.1.exe-plugin@0a89a91810a212d9413e26d8946d41fbab3e2b5400362d764a1523839c4d78ea" "https://plugins.dprint.dev/exec-0.2.1.exe-plugin@0a89a91810a212d9413e26d8946d41fbab3e2b5400362d764a1523839c4d78ea"
] ]

16
Cargo.lock generated
View file

@ -1261,9 +1261,9 @@ dependencies = [
[[package]] [[package]]
name = "dprint-core" name = "dprint-core"
version = "0.56.0" version = "0.58.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f2e06453dc1b63189dcfb0aae5bb98ad05f0d0d4f7e1647473f85921fcd1412" checksum = "8993a9e868c95a365957c95b7f4db599d10c87389a462ce30f102f2e1e9cec0d"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bumpalo", "bumpalo",
@ -1274,9 +1274,9 @@ dependencies = [
[[package]] [[package]]
name = "dprint-plugin-json" name = "dprint-plugin-json"
version = "0.15.2" version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ad67f601527f70a758acb95ec6adb3b3c0d00ca48010f1a0b5e4bec4a3e20ed" checksum = "f1e5fe967adc699073aa92ce4c931de1932ee58f4b755c3b32fed15580636558"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"dprint-core", "dprint-core",
@ -1287,9 +1287,9 @@ dependencies = [
[[package]] [[package]]
name = "dprint-plugin-markdown" name = "dprint-plugin-markdown"
version = "0.13.2" version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b262b1086542cf951a5ce81031f9e1727717bc5f8066e2289a7bf00a808baa96" checksum = "749753ef284b5eea8ab11e8baf01a735351c83747cdd72c5913e2351e6b8a309"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"dprint-core", "dprint-core",
@ -1300,9 +1300,9 @@ dependencies = [
[[package]] [[package]]
name = "dprint-plugin-typescript" name = "dprint-plugin-typescript"
version = "0.68.3" version = "0.68.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d20d1a1d9d423e890a9b2fd687abf68572d509ac40d9af6175793a36fc4af9b1" checksum = "ff59354542a49bd9039b848676cac14a1f83e3e4c891ed5684b5b8f2f5ae2890"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"deno_ast", "deno_ast",

View file

@ -62,9 +62,9 @@ clap_complete = "=3.1.2"
clap_complete_fig = "=3.1.5" clap_complete_fig = "=3.1.5"
data-url = "=0.1.1" data-url = "=0.1.1"
dissimilar = "=1.0.3" dissimilar = "=1.0.3"
dprint-plugin-json = "=0.15.2" dprint-plugin-json = "=0.15.3"
dprint-plugin-markdown = "=0.13.2" dprint-plugin-markdown = "=0.13.3"
dprint-plugin-typescript = "=0.68.3" dprint-plugin-typescript = "=0.68.4"
encoding_rs = "=0.8.31" encoding_rs = "=0.8.31"
env_logger = "=0.9.0" env_logger = "=0.9.0"
eszip = "=0.20.0" eszip = "=0.20.0"

View file

@ -569,10 +569,14 @@
/** @param {WritableStream} stream */ /** @param {WritableStream} stream */
function initializeWritableStream(stream) { function initializeWritableStream(stream) {
stream[_state] = "writable"; stream[_state] = "writable";
stream[_storedError] = stream[_writer] = stream[_controller] = stream[_storedError] =
stream[_inFlightWriteRequest] = stream[_closeRequest] = stream[_writer] =
stream[_inFlightCloseRequest] = stream[_pendingAbortRequest] = stream[_controller] =
undefined; stream[_inFlightWriteRequest] =
stream[_closeRequest] =
stream[_inFlightCloseRequest] =
stream[_pendingAbortRequest] =
undefined;
stream[_writeRequests] = []; stream[_writeRequests] = [];
stream[_backpressure] = false; stream[_backpressure] = false;
} }
@ -2944,8 +2948,11 @@
assert(stream[_controller] === undefined); assert(stream[_controller] === undefined);
controller[_stream] = stream; controller[_stream] = stream;
resetQueue(controller); resetQueue(controller);
controller[_started] = controller[_closeRequested] = controller[_started] =
controller[_pullAgain] = controller[_pulling] = false; controller[_closeRequested] =
controller[_pullAgain] =
controller[_pulling] =
false;
controller[_strategySizeAlgorithm] = sizeAlgorithm; controller[_strategySizeAlgorithm] = sizeAlgorithm;
controller[_strategyHWM] = highWaterMark; controller[_strategyHWM] = highWaterMark;
controller[_pullAlgorithm] = pullAlgorithm; controller[_pullAlgorithm] = pullAlgorithm;