From 61373138ccca4fb46cfb161126b8bd202961f45d Mon Sep 17 00:00:00 2001 From: "amaresh.sm" Date: Fri, 17 Jun 2022 23:40:06 +0530 Subject: [PATCH 1/3] fix: add missing images --- docs/.eleventy.js | 4 ++ .../src/developer-guide/architecture/index.md | 2 +- .../src/developer-guide/code-path-analysis.md | 48 +++++++++---------- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/docs/.eleventy.js b/docs/.eleventy.js index 49b6bbf0d5a..3a63e201e4a 100644 --- a/docs/.eleventy.js +++ b/docs/.eleventy.js @@ -316,6 +316,10 @@ module.exports = function(eleventyConfig) { "./node_modules/algoliasearch/dist/algoliasearch-lite.esm.browser.js": "/assets/js/algoliasearch.js" }); + eleventyConfig.addPassthroughCopy({ + "./src/developer-guide/**/*.svg": "/assets/images" + }); + //------------------------------------------------------------------------------ // Collections //------------------------------------------------------------------------------ diff --git a/docs/src/developer-guide/architecture/index.md b/docs/src/developer-guide/architecture/index.md index b2ec2bc194b..e5e43866840 100644 --- a/docs/src/developer-guide/architecture/index.md +++ b/docs/src/developer-guide/architecture/index.md @@ -5,7 +5,7 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/a --- -
dependency graph
+
dependency graph
At a high level, there are a few key parts to ESLint: diff --git a/docs/src/developer-guide/code-path-analysis.md b/docs/src/developer-guide/code-path-analysis.md index 9d2841b8cd9..8c438edde86 100644 --- a/docs/src/developer-guide/code-path-analysis.md +++ b/docs/src/developer-guide/code-path-analysis.md @@ -16,7 +16,7 @@ if (a && b) { bar(); ``` -![Code Path Example](./code-path-analysis/helo.svg) +![Code Path Example](./../assets/images/helo.svg) ## Objects @@ -145,17 +145,17 @@ bar(); 1. First, the analysis advances to the end of loop. - ![Loop Event's Example 1](./code-path-analysis/loop-event-example-while-1.svg) + ![Loop Event's Example 1](./../assets/images/loop-event-example-while-1.svg) 2. Second, it creates the looping path. At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired. It fires `onCodePathSegmentLoop` instead. - ![Loop Event's Example 2](./code-path-analysis/loop-event-example-while-2.svg) + ![Loop Event's Example 2](./../assets/images/loop-event-example-while-2.svg) 3. Last, it advances to the end. - ![Loop Event's Example 3](./code-path-analysis/loop-event-example-while-3.svg) + ![Loop Event's Example 3](./../assets/images/loop-event-example-while-3.svg) For example 2: @@ -170,29 +170,29 @@ bar(); First, the analysis advances to `ForStatement.update`. The `update` segment is hovered at first. - ![Loop Event's Example 1](./code-path-analysis/loop-event-example-for-1.svg) + ![Loop Event's Example 1](./../assets/images/loop-event-example-for-1.svg) 2. Second, it advances to `ForStatement.body`. Of course the `body` segment is preceded by the `test` segment. It keeps the `update` segment hovering. - ![Loop Event's Example 2](./code-path-analysis/loop-event-example-for-2.svg) + ![Loop Event's Example 2](./../assets/images/loop-event-example-for-2.svg) 3. Third, it creates the looping path from `body` segment to `update` segment. At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired. It fires `onCodePathSegmentLoop` instead. - ![Loop Event's Example 3](./code-path-analysis/loop-event-example-for-3.svg) + ![Loop Event's Example 3](./../assets/images/loop-event-example-for-3.svg) 4. Fourth, also it creates the looping path from `update` segment to `test` segment. At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired. It fires `onCodePathSegmentLoop` instead. - ![Loop Event's Example 4](./code-path-analysis/loop-event-example-for-4.svg) + ![Loop Event's Example 4](./../assets/images/loop-event-example-for-4.svg) 5. Last, it advances to the end. - ![Loop Event's Example 5](./code-path-analysis/loop-event-example-for-5.svg) + ![Loop Event's Example 5](./../assets/images/loop-event-example-for-5.svg) ## Usage Examples @@ -338,7 +338,7 @@ See Also: console.log("Hello world!"); ``` -![Hello World](./code-path-analysis/example-hello-world.svg) +![Hello World](./../assets/images/example-hello-world.svg) ### `IfStatement` @@ -350,7 +350,7 @@ if (a) { } ``` -![`IfStatement`](./code-path-analysis/example-ifstatement.svg) +![`IfStatement`](./../assets/images/example-ifstatement.svg) ### `IfStatement` (chain) @@ -364,7 +364,7 @@ if (a) { } ``` -![`IfStatement` (chain)](./code-path-analysis/example-ifstatement-chain.svg) +![`IfStatement` (chain)](./../assets/images/example-ifstatement-chain.svg) ### `SwitchStatement` @@ -385,7 +385,7 @@ switch (a) { } ``` -![`SwitchStatement`](./code-path-analysis/example-switchstatement.svg) +![`SwitchStatement`](./../assets/images/example-switchstatement.svg) ### `SwitchStatement` (has `default`) @@ -410,7 +410,7 @@ switch (a) { } ``` -![`SwitchStatement` (has `default`)](./code-path-analysis/example-switchstatement-has-default.svg) +![`SwitchStatement` (has `default`)](./../assets/images/example-switchstatement-has-default.svg) ### `TryStatement` (try-catch) @@ -433,7 +433,7 @@ It creates the paths from `try` block to `catch` block at: * The first throwable node (e.g. a function call) in the `try` block. * The end of the `try` block. -![`TryStatement` (try-catch)](./code-path-analysis/example-trystatement-try-catch.svg) +![`TryStatement` (try-catch)](./../assets/images/example-trystatement-try-catch.svg) ### `TryStatement` (try-finally) @@ -451,7 +451,7 @@ If there is not `catch` block, `finally` block has two current segments. At this time, `CodePath.currentSegments.length` is `2`. One is the normal path, and another is the leaving path (`throw` or `return`). -![`TryStatement` (try-finally)](./code-path-analysis/example-trystatement-try-finally.svg) +![`TryStatement` (try-finally)](./../assets/images/example-trystatement-try-finally.svg) ### `TryStatement` (try-catch-finally) @@ -467,7 +467,7 @@ try { last(); ``` -![`TryStatement` (try-catch-finally)](./code-path-analysis/example-trystatement-try-catch-finally.svg) +![`TryStatement` (try-catch-finally)](./../assets/images/example-trystatement-try-catch-finally.svg) ### `WhileStatement` @@ -481,7 +481,7 @@ while (a) { } ``` -![`WhileStatement`](./code-path-analysis/example-whilestatement.svg) +![`WhileStatement`](./../assets/images/example-whilestatement.svg) ### `DoWhileStatement` @@ -492,7 +492,7 @@ do { } while (a); ``` -![`DoWhileStatement`](./code-path-analysis/example-dowhilestatement.svg) +![`DoWhileStatement`](./../assets/images/example-dowhilestatement.svg) ### `ForStatement` @@ -506,7 +506,7 @@ for (let i = 0; i < 10; ++i) { } ``` -![`ForStatement`](./code-path-analysis/example-forstatement.svg) +![`ForStatement`](./../assets/images/example-forstatement.svg) ### `ForStatement` (for ever) @@ -517,7 +517,7 @@ for (;;) { bar(); ``` -![`ForStatement` (for ever)](./code-path-analysis/example-forstatement-for-ever.svg) +![`ForStatement` (for ever)](./../assets/images/example-forstatement-for-ever.svg) ### `ForInStatement` @@ -527,7 +527,7 @@ for (let key in obj) { } ``` -![`ForInStatement`](./code-path-analysis/example-forinstatement.svg) +![`ForInStatement`](./../assets/images/example-forinstatement.svg) ### When there is a function @@ -546,8 +546,8 @@ It creates two code paths. * The global's - ![When there is a function](./code-path-analysis/example-when-there-is-a-function-g.svg) + ![When there is a function](./../assets/images/example-when-there-is-a-function-g.svg) * The function's - ![When there is a function](./code-path-analysis/example-when-there-is-a-function-f.svg) + ![When there is a function](./../assets/images/example-when-there-is-a-function-f.svg) From c4958001e02437091ba554589b7f3d677e0ec425 Mon Sep 17 00:00:00 2001 From: "amaresh.sm" Date: Tue, 21 Jun 2022 00:22:56 +0530 Subject: [PATCH 2/3] chore: move images to asset folder --- docs/.eleventy.js | 4 -- .../images}/architecture/dependency.svg | 0 .../example-dowhilestatement.svg | 0 .../example-forinstatement.svg | 0 .../example-forstatement-for-ever.svg | 0 .../example-forstatement.svg | 0 .../example-hello-world.svg | 0 .../example-ifstatement-chain.svg | 0 .../example-ifstatement.svg | 0 .../example-switchstatement-has-default.svg | 0 .../example-switchstatement.svg | 0 ...example-trystatement-try-catch-finally.svg | 0 .../example-trystatement-try-catch.svg | 0 .../example-trystatement-try-finally.svg | 0 .../example-when-there-is-a-function-f.svg | 0 .../example-when-there-is-a-function-g.svg | 0 .../example-whilestatement.svg | 0 .../images}/code-path-analysis/helo.svg | 0 .../loop-event-example-for-1.svg | 0 .../loop-event-example-for-2.svg | 0 .../loop-event-example-for-3.svg | 0 .../loop-event-example-for-4.svg | 0 .../loop-event-example-for-5.svg | 0 .../loop-event-example-while-1.svg | 0 .../loop-event-example-while-2.svg | 0 .../loop-event-example-while-3.svg | 0 .../src/developer-guide/architecture/index.md | 2 +- .../src/developer-guide/code-path-analysis.md | 48 +++++++++---------- 28 files changed, 25 insertions(+), 29 deletions(-) rename docs/src/{developer-guide => assets/images}/architecture/dependency.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-dowhilestatement.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-forinstatement.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-forstatement-for-ever.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-forstatement.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-hello-world.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-ifstatement-chain.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-ifstatement.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-switchstatement-has-default.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-switchstatement.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-trystatement-try-catch-finally.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-trystatement-try-catch.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-trystatement-try-finally.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-when-there-is-a-function-f.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-when-there-is-a-function-g.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/example-whilestatement.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/helo.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/loop-event-example-for-1.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/loop-event-example-for-2.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/loop-event-example-for-3.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/loop-event-example-for-4.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/loop-event-example-for-5.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/loop-event-example-while-1.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/loop-event-example-while-2.svg (100%) rename docs/src/{developer-guide => assets/images}/code-path-analysis/loop-event-example-while-3.svg (100%) diff --git a/docs/.eleventy.js b/docs/.eleventy.js index 3a63e201e4a..49b6bbf0d5a 100644 --- a/docs/.eleventy.js +++ b/docs/.eleventy.js @@ -316,10 +316,6 @@ module.exports = function(eleventyConfig) { "./node_modules/algoliasearch/dist/algoliasearch-lite.esm.browser.js": "/assets/js/algoliasearch.js" }); - eleventyConfig.addPassthroughCopy({ - "./src/developer-guide/**/*.svg": "/assets/images" - }); - //------------------------------------------------------------------------------ // Collections //------------------------------------------------------------------------------ diff --git a/docs/src/developer-guide/architecture/dependency.svg b/docs/src/assets/images/architecture/dependency.svg similarity index 100% rename from docs/src/developer-guide/architecture/dependency.svg rename to docs/src/assets/images/architecture/dependency.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-dowhilestatement.svg b/docs/src/assets/images/code-path-analysis/example-dowhilestatement.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-dowhilestatement.svg rename to docs/src/assets/images/code-path-analysis/example-dowhilestatement.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-forinstatement.svg b/docs/src/assets/images/code-path-analysis/example-forinstatement.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-forinstatement.svg rename to docs/src/assets/images/code-path-analysis/example-forinstatement.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-forstatement-for-ever.svg b/docs/src/assets/images/code-path-analysis/example-forstatement-for-ever.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-forstatement-for-ever.svg rename to docs/src/assets/images/code-path-analysis/example-forstatement-for-ever.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-forstatement.svg b/docs/src/assets/images/code-path-analysis/example-forstatement.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-forstatement.svg rename to docs/src/assets/images/code-path-analysis/example-forstatement.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-hello-world.svg b/docs/src/assets/images/code-path-analysis/example-hello-world.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-hello-world.svg rename to docs/src/assets/images/code-path-analysis/example-hello-world.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-ifstatement-chain.svg b/docs/src/assets/images/code-path-analysis/example-ifstatement-chain.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-ifstatement-chain.svg rename to docs/src/assets/images/code-path-analysis/example-ifstatement-chain.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-ifstatement.svg b/docs/src/assets/images/code-path-analysis/example-ifstatement.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-ifstatement.svg rename to docs/src/assets/images/code-path-analysis/example-ifstatement.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-switchstatement-has-default.svg b/docs/src/assets/images/code-path-analysis/example-switchstatement-has-default.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-switchstatement-has-default.svg rename to docs/src/assets/images/code-path-analysis/example-switchstatement-has-default.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-switchstatement.svg b/docs/src/assets/images/code-path-analysis/example-switchstatement.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-switchstatement.svg rename to docs/src/assets/images/code-path-analysis/example-switchstatement.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-trystatement-try-catch-finally.svg b/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-trystatement-try-catch-finally.svg rename to docs/src/assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-trystatement-try-catch.svg b/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-trystatement-try-catch.svg rename to docs/src/assets/images/code-path-analysis/example-trystatement-try-catch.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-trystatement-try-finally.svg b/docs/src/assets/images/code-path-analysis/example-trystatement-try-finally.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-trystatement-try-finally.svg rename to docs/src/assets/images/code-path-analysis/example-trystatement-try-finally.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-when-there-is-a-function-f.svg b/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-f.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-when-there-is-a-function-f.svg rename to docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-f.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-when-there-is-a-function-g.svg b/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-g.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-when-there-is-a-function-g.svg rename to docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-g.svg diff --git a/docs/src/developer-guide/code-path-analysis/example-whilestatement.svg b/docs/src/assets/images/code-path-analysis/example-whilestatement.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/example-whilestatement.svg rename to docs/src/assets/images/code-path-analysis/example-whilestatement.svg diff --git a/docs/src/developer-guide/code-path-analysis/helo.svg b/docs/src/assets/images/code-path-analysis/helo.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/helo.svg rename to docs/src/assets/images/code-path-analysis/helo.svg diff --git a/docs/src/developer-guide/code-path-analysis/loop-event-example-for-1.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-for-1.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/loop-event-example-for-1.svg rename to docs/src/assets/images/code-path-analysis/loop-event-example-for-1.svg diff --git a/docs/src/developer-guide/code-path-analysis/loop-event-example-for-2.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-for-2.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/loop-event-example-for-2.svg rename to docs/src/assets/images/code-path-analysis/loop-event-example-for-2.svg diff --git a/docs/src/developer-guide/code-path-analysis/loop-event-example-for-3.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-for-3.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/loop-event-example-for-3.svg rename to docs/src/assets/images/code-path-analysis/loop-event-example-for-3.svg diff --git a/docs/src/developer-guide/code-path-analysis/loop-event-example-for-4.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-for-4.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/loop-event-example-for-4.svg rename to docs/src/assets/images/code-path-analysis/loop-event-example-for-4.svg diff --git a/docs/src/developer-guide/code-path-analysis/loop-event-example-for-5.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-for-5.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/loop-event-example-for-5.svg rename to docs/src/assets/images/code-path-analysis/loop-event-example-for-5.svg diff --git a/docs/src/developer-guide/code-path-analysis/loop-event-example-while-1.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-while-1.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/loop-event-example-while-1.svg rename to docs/src/assets/images/code-path-analysis/loop-event-example-while-1.svg diff --git a/docs/src/developer-guide/code-path-analysis/loop-event-example-while-2.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-while-2.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/loop-event-example-while-2.svg rename to docs/src/assets/images/code-path-analysis/loop-event-example-while-2.svg diff --git a/docs/src/developer-guide/code-path-analysis/loop-event-example-while-3.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-while-3.svg similarity index 100% rename from docs/src/developer-guide/code-path-analysis/loop-event-example-while-3.svg rename to docs/src/assets/images/code-path-analysis/loop-event-example-while-3.svg diff --git a/docs/src/developer-guide/architecture/index.md b/docs/src/developer-guide/architecture/index.md index e5e43866840..7b9f66f3c26 100644 --- a/docs/src/developer-guide/architecture/index.md +++ b/docs/src/developer-guide/architecture/index.md @@ -5,7 +5,7 @@ edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/a --- -
dependency graph
+
dependency graph
At a high level, there are a few key parts to ESLint: diff --git a/docs/src/developer-guide/code-path-analysis.md b/docs/src/developer-guide/code-path-analysis.md index 8c438edde86..b89e4ec21d0 100644 --- a/docs/src/developer-guide/code-path-analysis.md +++ b/docs/src/developer-guide/code-path-analysis.md @@ -16,7 +16,7 @@ if (a && b) { bar(); ``` -![Code Path Example](./../assets/images/helo.svg) +![Code Path Example](./../assets/images/code-path-analysis/helo.svg) ## Objects @@ -145,17 +145,17 @@ bar(); 1. First, the analysis advances to the end of loop. - ![Loop Event's Example 1](./../assets/images/loop-event-example-while-1.svg) + ![Loop Event's Example 1](./../assets/images/code-path-analysis/loop-event-example-while-1.svg) 2. Second, it creates the looping path. At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired. It fires `onCodePathSegmentLoop` instead. - ![Loop Event's Example 2](./../assets/images/loop-event-example-while-2.svg) + ![Loop Event's Example 2](./../assets/images/code-path-analysis/loop-event-example-while-2.svg) 3. Last, it advances to the end. - ![Loop Event's Example 3](./../assets/images/loop-event-example-while-3.svg) + ![Loop Event's Example 3](./../assets/images/code-path-analysis/loop-event-example-while-3.svg) For example 2: @@ -170,29 +170,29 @@ bar(); First, the analysis advances to `ForStatement.update`. The `update` segment is hovered at first. - ![Loop Event's Example 1](./../assets/images/loop-event-example-for-1.svg) + ![Loop Event's Example 1](./../assets/images/code-path-analysis/loop-event-example-for-1.svg) 2. Second, it advances to `ForStatement.body`. Of course the `body` segment is preceded by the `test` segment. It keeps the `update` segment hovering. - ![Loop Event's Example 2](./../assets/images/loop-event-example-for-2.svg) + ![Loop Event's Example 2](./../assets/images/code-path-analysis/loop-event-example-for-2.svg) 3. Third, it creates the looping path from `body` segment to `update` segment. At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired. It fires `onCodePathSegmentLoop` instead. - ![Loop Event's Example 3](./../assets/images/loop-event-example-for-3.svg) + ![Loop Event's Example 3](./../assets/images/code-path-analysis/loop-event-example-for-3.svg) 4. Fourth, also it creates the looping path from `update` segment to `test` segment. At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired. It fires `onCodePathSegmentLoop` instead. - ![Loop Event's Example 4](./../assets/images/loop-event-example-for-4.svg) + ![Loop Event's Example 4](./../assets/images/code-path-analysis/loop-event-example-for-4.svg) 5. Last, it advances to the end. - ![Loop Event's Example 5](./../assets/images/loop-event-example-for-5.svg) + ![Loop Event's Example 5](./../assets/images/code-path-analysis/loop-event-example-for-5.svg) ## Usage Examples @@ -338,7 +338,7 @@ See Also: console.log("Hello world!"); ``` -![Hello World](./../assets/images/example-hello-world.svg) +![Hello World](./../assets/images/code-path-analysis/example-hello-world.svg) ### `IfStatement` @@ -350,7 +350,7 @@ if (a) { } ``` -![`IfStatement`](./../assets/images/example-ifstatement.svg) +![`IfStatement`](./../assets/images/code-path-analysis/example-ifstatement.svg) ### `IfStatement` (chain) @@ -364,7 +364,7 @@ if (a) { } ``` -![`IfStatement` (chain)](./../assets/images/example-ifstatement-chain.svg) +![`IfStatement` (chain)](./../assets/images/code-path-analysis/example-ifstatement-chain.svg) ### `SwitchStatement` @@ -385,7 +385,7 @@ switch (a) { } ``` -![`SwitchStatement`](./../assets/images/example-switchstatement.svg) +![`SwitchStatement`](./../assets/images/code-path-analysis/example-switchstatement.svg) ### `SwitchStatement` (has `default`) @@ -410,7 +410,7 @@ switch (a) { } ``` -![`SwitchStatement` (has `default`)](./../assets/images/example-switchstatement-has-default.svg) +![`SwitchStatement` (has `default`)](./../assets/images/code-path-analysis/example-switchstatement-has-default.svg) ### `TryStatement` (try-catch) @@ -433,7 +433,7 @@ It creates the paths from `try` block to `catch` block at: * The first throwable node (e.g. a function call) in the `try` block. * The end of the `try` block. -![`TryStatement` (try-catch)](./../assets/images/example-trystatement-try-catch.svg) +![`TryStatement` (try-catch)](./../assets/images/code-path-analysis/example-trystatement-try-catch.svg) ### `TryStatement` (try-finally) @@ -451,7 +451,7 @@ If there is not `catch` block, `finally` block has two current segments. At this time, `CodePath.currentSegments.length` is `2`. One is the normal path, and another is the leaving path (`throw` or `return`). -![`TryStatement` (try-finally)](./../assets/images/example-trystatement-try-finally.svg) +![`TryStatement` (try-finally)](./../assets/images/code-path-analysis/example-trystatement-try-finally.svg) ### `TryStatement` (try-catch-finally) @@ -467,7 +467,7 @@ try { last(); ``` -![`TryStatement` (try-catch-finally)](./../assets/images/example-trystatement-try-catch-finally.svg) +![`TryStatement` (try-catch-finally)](./../assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg) ### `WhileStatement` @@ -481,7 +481,7 @@ while (a) { } ``` -![`WhileStatement`](./../assets/images/example-whilestatement.svg) +![`WhileStatement`](./../assets/images/code-path-analysis/example-whilestatement.svg) ### `DoWhileStatement` @@ -492,7 +492,7 @@ do { } while (a); ``` -![`DoWhileStatement`](./../assets/images/example-dowhilestatement.svg) +![`DoWhileStatement`](./../assets/images/code-path-analysis/example-dowhilestatement.svg) ### `ForStatement` @@ -506,7 +506,7 @@ for (let i = 0; i < 10; ++i) { } ``` -![`ForStatement`](./../assets/images/example-forstatement.svg) +![`ForStatement`](./../assets/images/code-path-analysis/example-forstatement.svg) ### `ForStatement` (for ever) @@ -517,7 +517,7 @@ for (;;) { bar(); ``` -![`ForStatement` (for ever)](./../assets/images/example-forstatement-for-ever.svg) +![`ForStatement` (for ever)](./../assets/images/code-path-analysis/example-forstatement-for-ever.svg) ### `ForInStatement` @@ -527,7 +527,7 @@ for (let key in obj) { } ``` -![`ForInStatement`](./../assets/images/example-forinstatement.svg) +![`ForInStatement`](./../assets/images/code-path-analysis/example-forinstatement.svg) ### When there is a function @@ -546,8 +546,8 @@ It creates two code paths. * The global's - ![When there is a function](./../assets/images/example-when-there-is-a-function-g.svg) + ![When there is a function](./../assets/images/code-path-analysis/example-when-there-is-a-function-g.svg) * The function's - ![When there is a function](./../assets/images/example-when-there-is-a-function-f.svg) + ![When there is a function](./../assets/images/code-path-analysis/example-when-there-is-a-function-f.svg) From 3c4f34e29ede85a516501250c58889517ede1d17 Mon Sep 17 00:00:00 2001 From: "amaresh.sm" Date: Wed, 22 Jun 2022 00:42:21 +0530 Subject: [PATCH 3/3] chore: update path --- .../src/developer-guide/code-path-analysis.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/src/developer-guide/code-path-analysis.md b/docs/src/developer-guide/code-path-analysis.md index b89e4ec21d0..17daf3196cc 100644 --- a/docs/src/developer-guide/code-path-analysis.md +++ b/docs/src/developer-guide/code-path-analysis.md @@ -16,7 +16,7 @@ if (a && b) { bar(); ``` -![Code Path Example](./../assets/images/code-path-analysis/helo.svg) +![Code Path Example](../assets/images/code-path-analysis/helo.svg) ## Objects @@ -145,17 +145,17 @@ bar(); 1. First, the analysis advances to the end of loop. - ![Loop Event's Example 1](./../assets/images/code-path-analysis/loop-event-example-while-1.svg) + ![Loop Event's Example 1](../assets/images/code-path-analysis/loop-event-example-while-1.svg) 2. Second, it creates the looping path. At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired. It fires `onCodePathSegmentLoop` instead. - ![Loop Event's Example 2](./../assets/images/code-path-analysis/loop-event-example-while-2.svg) + ![Loop Event's Example 2](../assets/images/code-path-analysis/loop-event-example-while-2.svg) 3. Last, it advances to the end. - ![Loop Event's Example 3](./../assets/images/code-path-analysis/loop-event-example-while-3.svg) + ![Loop Event's Example 3](../assets/images/code-path-analysis/loop-event-example-while-3.svg) For example 2: @@ -170,29 +170,29 @@ bar(); First, the analysis advances to `ForStatement.update`. The `update` segment is hovered at first. - ![Loop Event's Example 1](./../assets/images/code-path-analysis/loop-event-example-for-1.svg) + ![Loop Event's Example 1](../assets/images/code-path-analysis/loop-event-example-for-1.svg) 2. Second, it advances to `ForStatement.body`. Of course the `body` segment is preceded by the `test` segment. It keeps the `update` segment hovering. - ![Loop Event's Example 2](./../assets/images/code-path-analysis/loop-event-example-for-2.svg) + ![Loop Event's Example 2](../assets/images/code-path-analysis/loop-event-example-for-2.svg) 3. Third, it creates the looping path from `body` segment to `update` segment. At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired. It fires `onCodePathSegmentLoop` instead. - ![Loop Event's Example 3](./../assets/images/code-path-analysis/loop-event-example-for-3.svg) + ![Loop Event's Example 3](../assets/images/code-path-analysis/loop-event-example-for-3.svg) 4. Fourth, also it creates the looping path from `update` segment to `test` segment. At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired. It fires `onCodePathSegmentLoop` instead. - ![Loop Event's Example 4](./../assets/images/code-path-analysis/loop-event-example-for-4.svg) + ![Loop Event's Example 4](../assets/images/code-path-analysis/loop-event-example-for-4.svg) 5. Last, it advances to the end. - ![Loop Event's Example 5](./../assets/images/code-path-analysis/loop-event-example-for-5.svg) + ![Loop Event's Example 5](../assets/images/code-path-analysis/loop-event-example-for-5.svg) ## Usage Examples @@ -338,7 +338,7 @@ See Also: console.log("Hello world!"); ``` -![Hello World](./../assets/images/code-path-analysis/example-hello-world.svg) +![Hello World](../assets/images/code-path-analysis/example-hello-world.svg) ### `IfStatement` @@ -350,7 +350,7 @@ if (a) { } ``` -![`IfStatement`](./../assets/images/code-path-analysis/example-ifstatement.svg) +![`IfStatement`](../assets/images/code-path-analysis/example-ifstatement.svg) ### `IfStatement` (chain) @@ -364,7 +364,7 @@ if (a) { } ``` -![`IfStatement` (chain)](./../assets/images/code-path-analysis/example-ifstatement-chain.svg) +![`IfStatement` (chain)](../assets/images/code-path-analysis/example-ifstatement-chain.svg) ### `SwitchStatement` @@ -385,7 +385,7 @@ switch (a) { } ``` -![`SwitchStatement`](./../assets/images/code-path-analysis/example-switchstatement.svg) +![`SwitchStatement`](../assets/images/code-path-analysis/example-switchstatement.svg) ### `SwitchStatement` (has `default`) @@ -410,7 +410,7 @@ switch (a) { } ``` -![`SwitchStatement` (has `default`)](./../assets/images/code-path-analysis/example-switchstatement-has-default.svg) +![`SwitchStatement` (has `default`)](../assets/images/code-path-analysis/example-switchstatement-has-default.svg) ### `TryStatement` (try-catch) @@ -433,7 +433,7 @@ It creates the paths from `try` block to `catch` block at: * The first throwable node (e.g. a function call) in the `try` block. * The end of the `try` block. -![`TryStatement` (try-catch)](./../assets/images/code-path-analysis/example-trystatement-try-catch.svg) +![`TryStatement` (try-catch)](../assets/images/code-path-analysis/example-trystatement-try-catch.svg) ### `TryStatement` (try-finally) @@ -451,7 +451,7 @@ If there is not `catch` block, `finally` block has two current segments. At this time, `CodePath.currentSegments.length` is `2`. One is the normal path, and another is the leaving path (`throw` or `return`). -![`TryStatement` (try-finally)](./../assets/images/code-path-analysis/example-trystatement-try-finally.svg) +![`TryStatement` (try-finally)](../assets/images/code-path-analysis/example-trystatement-try-finally.svg) ### `TryStatement` (try-catch-finally) @@ -467,7 +467,7 @@ try { last(); ``` -![`TryStatement` (try-catch-finally)](./../assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg) +![`TryStatement` (try-catch-finally)](../assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg) ### `WhileStatement` @@ -481,7 +481,7 @@ while (a) { } ``` -![`WhileStatement`](./../assets/images/code-path-analysis/example-whilestatement.svg) +![`WhileStatement`](../assets/images/code-path-analysis/example-whilestatement.svg) ### `DoWhileStatement` @@ -492,7 +492,7 @@ do { } while (a); ``` -![`DoWhileStatement`](./../assets/images/code-path-analysis/example-dowhilestatement.svg) +![`DoWhileStatement`](../assets/images/code-path-analysis/example-dowhilestatement.svg) ### `ForStatement` @@ -506,7 +506,7 @@ for (let i = 0; i < 10; ++i) { } ``` -![`ForStatement`](./../assets/images/code-path-analysis/example-forstatement.svg) +![`ForStatement`](../assets/images/code-path-analysis/example-forstatement.svg) ### `ForStatement` (for ever) @@ -517,7 +517,7 @@ for (;;) { bar(); ``` -![`ForStatement` (for ever)](./../assets/images/code-path-analysis/example-forstatement-for-ever.svg) +![`ForStatement` (for ever)](../assets/images/code-path-analysis/example-forstatement-for-ever.svg) ### `ForInStatement` @@ -527,7 +527,7 @@ for (let key in obj) { } ``` -![`ForInStatement`](./../assets/images/code-path-analysis/example-forinstatement.svg) +![`ForInStatement`](../assets/images/code-path-analysis/example-forinstatement.svg) ### When there is a function @@ -546,8 +546,8 @@ It creates two code paths. * The global's - ![When there is a function](./../assets/images/code-path-analysis/example-when-there-is-a-function-g.svg) + ![When there is a function](../assets/images/code-path-analysis/example-when-there-is-a-function-g.svg) * The function's - ![When there is a function](./../assets/images/code-path-analysis/example-when-there-is-a-function-f.svg) + ![When there is a function](../assets/images/code-path-analysis/example-when-there-is-a-function-f.svg)