├── .github ├── ISSUE_TEMPLATE │ └── bug_report.md ├── assignment.yml ├── locker.yml └── needs_more_info.yml ├── .gitignore ├── .npmignore ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── .vscodeignore ├── .vsts ├── .vsts-ci.yml └── job.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── SECURITY.md ├── ThirdPartyNotices.txt ├── gulpfile.js ├── i18n ├── chs │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json ├── cht │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json ├── csy │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json ├── deu │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json ├── esn │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json ├── fra │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json ├── ita │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json ├── jpn │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json ├── kor │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json ├── plk │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json ├── ptb │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json ├── rus │ ├── out │ │ └── src │ │ │ ├── chromeDebugAdapter.i18n.json │ │ │ ├── errors.i18n.json │ │ │ └── extension.i18n.json │ └── package.i18n.json └── trk │ ├── out │ └── src │ │ ├── chromeDebugAdapter.i18n.json │ │ ├── errors.i18n.json │ │ └── extension.i18n.json │ └── package.i18n.json ├── images ├── demo.gif ├── icon.png └── screenshot.png ├── msbuild ├── ChromeDebugAdapter.csproj └── ChromeDebugAdapter.sln ├── package-lock.json ├── package.json ├── package.nls.cs.json ├── package.nls.de.json ├── package.nls.es.json ├── package.nls.fr.json ├── package.nls.it.json ├── package.nls.ja.json ├── package.nls.json ├── package.nls.ko.json ├── package.nls.pl.json ├── package.nls.pt-br.json ├── package.nls.ru.json ├── package.nls.tr.json ├── package.nls.zh-cn.json ├── package.nls.zh-tw.json ├── src ├── chromeDebug.ts ├── chromeDebugAdapter.ts ├── chromeDebugInterfaces.d.ts ├── chromeProvidedPortConnection.ts ├── chromeSpawnHelper.ts ├── errors.ts ├── extension.ts ├── launchUnelevated.js └── utils.ts ├── test ├── chromeDebugAdapter.test.ts ├── debugProtocolMocks.ts ├── int │ ├── README.md │ ├── adapter.test.ts │ ├── breakOnLoad.test.ts │ ├── breakpoints.test.ts │ ├── core-v2 │ │ ├── chrome │ │ │ ├── collections │ │ │ │ ├── async.ts │ │ │ │ ├── bidirectionalMap.ts │ │ │ │ ├── printing.ts │ │ │ │ ├── utilities.ts │ │ │ │ ├── validatedMap.ts │ │ │ │ ├── validatedMultiMap.ts │ │ │ │ └── validatedSet.ts │ │ │ ├── internal │ │ │ │ ├── breakpoints │ │ │ │ │ └── bpActionWhenHit.ts │ │ │ │ └── locations │ │ │ │ │ ├── location.ts │ │ │ │ │ └── subtypes.ts │ │ │ ├── logging │ │ │ │ ├── methodsCalledLogger.ts │ │ │ │ └── printObjectDescription.ts │ │ │ └── utils │ │ │ │ └── equivalence.ts │ │ ├── typeUtils.ts │ │ └── validation.ts │ ├── featureBasedSuits │ │ ├── hitCountBreakpointTests.test.ts │ │ ├── hitCountBreakpointsDifferentOperators.test.ts │ │ ├── inlineScripts.test.ts │ │ └── variablesScopes.test.ts │ ├── fixtures │ │ ├── defaultFixture.ts │ │ ├── fixture.ts │ │ ├── launchProject.ts │ │ ├── launchWebServer.ts │ │ ├── multipleFixtures.ts │ │ └── testUsing.ts │ ├── framework │ │ ├── README.md │ │ ├── framework.react.test.ts │ │ ├── framework.support.test.ts │ │ ├── frameworkCommonTests.ts │ │ └── frameworkTestSupport.ts │ ├── intTestSupport.ts │ ├── labels.ts │ ├── puppeteer │ │ ├── README.md │ │ ├── launchPuppeteer.ts │ │ ├── puppeteerSuite.ts │ │ ├── puppeteerSupport.ts │ │ └── puppeteerTypeFix.d.ts │ ├── resources │ │ └── resourceProjects.ts │ ├── stackTrace.test.ts │ ├── stepping.test.ts │ ├── testConfig.json │ ├── testSetup.ts │ ├── types │ │ ├── object.ts │ │ └── server.ts │ ├── utils │ │ ├── findPositionOfTextInFile.ts │ │ ├── humanSlownessSimulator.ts │ │ ├── logging.ts │ │ ├── repeat.ts │ │ └── waitUntilReadyWithTimeout.ts │ └── wizards │ │ ├── breakpoints │ │ ├── breakpointWizard.ts │ │ ├── breakpointsWizard.ts │ │ ├── fileBreakpointsWizard.ts │ │ └── implementation │ │ │ ├── PerformChangesImmediatelyState.ts │ │ │ ├── batchingUpdatesState.ts │ │ │ ├── breakpointsAssertions.ts │ │ │ ├── breakpointsUpdater.ts │ │ │ ├── internalFileBreakpointsWizard.ts │ │ │ ├── printedTestInputl.ts │ │ │ ├── stackTraceObjectAssertions.ts │ │ │ └── stackTraceStringAssertions.ts │ │ ├── pausedWizard.ts │ │ └── variables │ │ ├── ManyVariablesPropertiesPrinted.ts │ │ ├── stackFrameWizard.ts │ │ ├── variablesPrinting.ts │ │ ├── variablesVerifier.ts │ │ └── variablesWizard.ts ├── testUtils.ts ├── tsconfig.json └── utils.test.ts ├── testdata ├── breakOnLoad_javaScript │ ├── index.html │ └── src │ │ ├── script.js │ │ └── script2.js ├── breakOnLoad_sourceMaps │ ├── index.html │ ├── out │ │ ├── SubDir │ │ │ ├── script.js │ │ │ └── script.js.map │ │ ├── script.bin.js │ │ ├── script.bin.js.map │ │ ├── script.js │ │ ├── script.js.map │ │ ├── script1.js │ │ └── script1.js.map │ ├── src │ │ └── script.ts │ └── tsconfig.json ├── breakOnLoad_webpack │ ├── dist │ │ ├── bundle.js │ │ ├── bundle.js.map │ │ └── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── script.js │ └── webpack.config.js ├── calls-between-merged-files │ ├── .vscode │ │ ├── launch.json │ │ └── tasks.json │ ├── gulpfile.js │ ├── index.html │ ├── out │ │ ├── b.js │ │ ├── b.js.map │ │ ├── sourceA.js │ │ └── sourceA.js.map │ ├── package.json │ ├── sourceA.ts │ ├── sourceB1.ts │ ├── sourceB2.ts │ └── tsconfig.json ├── calls-between-sourcemapped-files │ ├── index.html │ ├── out │ │ ├── sourceA.js │ │ ├── sourceA.js.map │ │ ├── sourceB.js │ │ └── sourceB.js.map │ ├── src │ │ ├── sourceA.ts │ │ └── sourceB.ts │ └── tsconfig.json ├── columns │ ├── index.html │ ├── out │ │ ├── script.js │ │ └── script.js.map │ ├── src │ │ └── script.ts │ └── tsconfig.json ├── inline_scripts │ ├── .vscode │ │ └── launch.json │ ├── multiple.html │ └── single.html ├── intervalDebugger │ ├── index.html │ ├── out │ │ ├── app.js │ │ └── app.js.map │ ├── src │ │ └── app.ts │ └── tsconfig.json ├── labelTest.ts ├── react │ ├── .gitignore │ ├── .vscode │ │ └── launch.json │ ├── README.md │ ├── config │ │ ├── env.js │ │ ├── jest │ │ │ ├── cssTransform.js │ │ │ └── fileTransform.js │ │ ├── paths.js │ │ ├── webpack.config.js │ │ └── webpackDevServer.config.js │ ├── dist │ │ ├── index.html │ │ ├── out │ │ │ ├── 0.chunk.js │ │ │ ├── 0.chunk.js.map │ │ │ ├── bundle.js │ │ │ ├── bundle.js.map │ │ │ ├── main.chunk.js │ │ │ └── main.chunk.js.map │ │ └── src │ │ │ ├── App.js │ │ │ ├── App.test.js │ │ │ ├── Counter.jsx │ │ │ ├── Running.js │ │ │ └── index.js │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── manifest.json │ ├── scripts │ │ ├── build.js │ │ ├── start.js │ │ └── test.js │ └── src │ │ ├── App.js │ │ ├── App.test.js │ │ ├── Counter.jsx │ │ ├── Running.js │ │ └── index.js ├── react_with_loop │ ├── .gitignore │ ├── .vscode │ │ └── launch.json │ ├── README.md │ ├── config │ │ ├── env.js │ │ ├── jest │ │ │ ├── cssTransform.js │ │ │ └── fileTransform.js │ │ ├── paths.js │ │ ├── webpack.config.js │ │ └── webpackDevServer.config.js │ ├── dist │ │ ├── index.html │ │ ├── out │ │ │ ├── 0.chunk.js │ │ │ ├── 0.chunk.js.map │ │ │ ├── bundle.js │ │ │ ├── bundle.js.map │ │ │ ├── main.chunk.js │ │ │ └── main.chunk.js.map │ │ └── src │ │ │ ├── App.js │ │ │ ├── App.test.js │ │ │ ├── Counter.jsx │ │ │ ├── Running.js │ │ │ └── index.js │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── manifest.json │ ├── scripts │ │ ├── build.js │ │ ├── start.js │ │ └── test.js │ └── src │ │ ├── App.js │ │ ├── App.test.js │ │ ├── Counter.jsx │ │ ├── Running.js │ │ └── index.js ├── simple │ ├── app.js │ └── index.html ├── stackTrace │ ├── app.js │ └── index.html └── variablesScopes │ ├── .vscode │ └── launch.json │ ├── blockScope │ ├── blockVariablesApp.js │ └── index.html │ ├── catchScope │ ├── .vscode │ │ └── launch.json │ ├── catchVariablesApp.js │ └── index.html │ ├── closureScope │ ├── closureVariablesApp.js │ └── index.html │ ├── evalScope │ ├── evalVariablesApp.js │ └── index.html │ ├── globalScope │ ├── globalVariablesApp.js │ └── index.html │ ├── localScope │ ├── index.html │ └── scriptVariablesApp.js │ ├── moduleScope │ ├── index.html │ ├── moduleVariablesApp.js │ ├── moduleVariablesApp.ts │ └── tsconfig.json │ ├── scriptScope │ ├── index.html │ └── scriptVariablesApp.js │ └── withScope │ ├── index.html │ └── withVariablesApp.js ├── tsconfig.json └── tslint.json /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Do not file issues here! 3 | about: VS Code has a new debugger which can be found in the vscode-js-debug repo 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 21 | -------------------------------------------------------------------------------- /.github/assignment.yml: -------------------------------------------------------------------------------- 1 | { 2 | perform: true, 3 | assignees: [ roblourens ] 4 | } -------------------------------------------------------------------------------- /.github/locker.yml: -------------------------------------------------------------------------------- 1 | { 2 | daysAfterClose: 30, 3 | daysSinceLastUpdate: 3, 4 | perform: true 5 | } -------------------------------------------------------------------------------- /.github/needs_more_info.yml: -------------------------------------------------------------------------------- 1 | { 2 | daysUntilClose: 7, 3 | needsMoreInfoLabel: 'needs more info', 4 | perform: true, 5 | closeComment: 'This issue has been closed automatically because it needs more information and has not had recent activity. Please refer to our [guidelines](https://github.com/Microsoft/vscode/blob/master/CONTRIBUTING.md) for filing issues. Thank you for your contributions.' 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .browse.VC.db 3 | vscode-chrome-debug.txt 4 | npm-debug.log 5 | *.vsix 6 | 7 | lib/ 8 | node_modules/ 9 | /out/ 10 | typings/ 11 | testapp/.vscode/chrome 12 | testapp/**/out/ 13 | test-results.xml 14 | bin 15 | obj 16 | logs -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .browse.VC.db 3 | vscode-chrome-debug.txt 4 | npm-debug.log 5 | *.vsix 6 | gulpfile.js 7 | tsconfig.json 8 | tslint.json 9 | 10 | lib/ 11 | node_modules/ 12 | typings/ 13 | testapp/.vscode/chrome 14 | testapp/**/out/ 15 | test-results.xml 16 | bin 17 | obj 18 | logs 19 | out/test/ 20 | testdata/ 21 | test/ -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.insertSpaces": true, 3 | "files.trimTrailingWhitespace": true, 4 | "files.exclude": { 5 | ".git": true, 6 | "bin": true, 7 | "node_modules": false, 8 | "package.nls.*.json": true 9 | }, 10 | "search.exclude": { 11 | ".git": true, 12 | "node_modules": true, 13 | "bin": true, 14 | "out": true 15 | } 16 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "npm", 6 | "script": "watch", 7 | "problemMatcher": "$gulp-tsc", 8 | "group": { 9 | "kind": "build", 10 | "isDefault": true 11 | }, 12 | "isBackground": true 13 | }, 14 | { 15 | "type": "gulp", 16 | "task": "i18n-import", 17 | "problemMatcher": [] 18 | }, 19 | { 20 | "type": "gulp", 21 | "task": "add-i18n", 22 | "problemMatcher": [] 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | **/*.ts 2 | **/*.map 3 | .vscode/** 4 | lib/** 5 | typings/** 6 | testapp/** 7 | testdata/** 8 | test/** 9 | *.vsix 10 | gulpfile.js 11 | tsconfig.json 12 | tsd.json 13 | tslint.json 14 | vscode-chrome-debug.txt 15 | images/demo.gif 16 | 17 | out/test/** 18 | 19 | node_modules/.bin/** 20 | node_modules/bufferutil/** 21 | node_modules/utf-8-validate/** 22 | node_modules/vscode-chrome-debug-core/node_modules/ws/node_modules/bufferutil/** 23 | node_modules/vscode-chrome-debug-core/node_modules/ws/node_modules/utf-8-validate/** 24 | 25 | node_modules/vscode-chrome-debug-core/out/test/** 26 | node_modules/vscode-chrome-debug-core/typings/** 27 | 28 | i18n/csy 29 | i18n/trk 30 | i18n/ptb 31 | i18n/plk 32 | package.nls.cs.json 33 | package.nls.tr.json 34 | package.nls.pt-br.json 35 | package.nls.pl.json 36 | node_modules/vscode-chrome-debug-core/i18n/csy/** 37 | node_modules/vscode-chrome-debug-core/i18n/trk/** 38 | node_modules/vscode-chrome-debug-core/i18n/ptb/** 39 | node_modules/vscode-chrome-debug-core/i18n/plk/** 40 | 41 | node_modules/devtools-protocol/** -------------------------------------------------------------------------------- /.vsts/.vsts-ci.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: job.yml 3 | parameters: 4 | name: macOS 5 | vmImage: 'macOS-latest' 6 | 7 | - template: job.yml 8 | parameters: 9 | name: Linux 10 | vmImage: 'ubuntu-16.04' 11 | 12 | - template: job.yml 13 | parameters: 14 | name: Windows 15 | vmImage: 'vs2017-win2016' -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are always welcome! I only ask that you open an issue first so we can discuss the problem and solution. I just don't want you to waste any time headed in the wrong direction. 4 | 5 | ## Development setup 6 | 7 | * Clone this repo 8 | * Run `npm install -g gulp` and `npm install` in '/vscode-chrome-debug' 9 | * You may see an error if `bufferutil` or `utf-8-validate` fail to build. These native modules required by `ws` are optional and the adapter should work fine without them. 10 | * Run `gulp build` 11 | 12 | ## Developing in the vscode-chrome-debug-core module 13 | Most of the code is actually in [this repo](https://github.com/Microsoft/vscode-chrome-debug-core) which is published in npm as `vscode-chrome-debug-core`. You can clone that repo separately to any directory and use `npm link` to test the extension with a modified version. 14 | 15 | ## Debugging 16 | In VS Code, run the `launch as server` launch config - it will start the adapter as a server listening on port 4712. In your test app launch.json, include this flag at the top level: `"debugServer": "4712"`. Then you'll be able to debug the adapter in the first instance of VS Code, in its original TypeScript, using sourcemaps. 17 | 18 | ## Testing 19 | There is a set of mocha tests which can be run with `gulp test` or with the `test` launch config. Also run `gulp tslint` to check your code against our tslint rules. 20 | 21 | See the project under testapp/ for a bunch of test scenarios crammed onto one page. 22 | 23 | ## Naming 24 | * "Client": VS Code 25 | * "Target": The debuggee, which implements the Chrome Debug Protocol 26 | * "Server-mode": In the normal use-case, the extension does not run in server-mode. For debugging, you can run it as a debug server - see the 'Debugging' section above. 27 | 28 | ## Issue tags 29 | * "Bug": Something that should work is broken 30 | * "Enhancement": AKA feature request - adds new functionality 31 | * "Task": Something that needs to be done that doesn't really fix anything or add major functionality. Tests, engineering, documentation, etc. -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | VS Code - Debugger for Chrome 2 | 3 | Copyright (c) Microsoft Corporation 4 | 5 | All rights reserved. 6 | 7 | MIT License 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /ThirdPartyNotices.txt: -------------------------------------------------------------------------------- 1 | This project may use or incorporate third party material from the projects listed below. The original copyright notice and the license under which Microsoft received such third party material are set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. 2 | 3 | websockets-ws 4 | 5 | (The MIT License) 6 | 7 | Copyright (c) 2011 Einar Otto Stangvik 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | -------------------------------------------------------------------------------- /i18n/chs/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "找不到 Chrome - 进行安装或在启动配置中设置 \"runtimeExecutable\" 字段。" 8 | } -------------------------------------------------------------------------------- /i18n/chs/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "属性 {0} 不存在({1})。" 8 | } -------------------------------------------------------------------------------- /i18n/chs/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "针对 localhost 启动 Chrome", 8 | "chrome.targets.placeholder": "选择一个选项卡" 9 | } -------------------------------------------------------------------------------- /i18n/chs/package.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "extension.description": "在 Chrome 浏览器或任何其他支持 Chrome 调试器协议的目标中调试 JavaScript 代码。", 8 | "chrome.toggleSkipping.title": "Chrome:“跳过此文件”开关", 9 | "chrome.toggleSmartStep.title": "Chrome:“智能步骤”开关", 10 | "chrome.port.description": "用于 Chrome 远程调试的端口。", 11 | "chrome.address.description": "调试端口的 TCP/IP 地址。", 12 | "chrome.file.description": "要在浏览器中打开的本地 HTML 文件", 13 | "chrome.url.description": "将使用此确切 URL 搜索标签,找到后将连接到该标签", 14 | "chrome.webRoot.description": "此设置指定 Web 服务器根的工作区绝对路径。用于将 `/app.js` 等路径解析为磁盘上的文件。pathMapping 的速记方式为 \"/\"", 15 | "chrome.pathMapping.description": "本地文件夹的 URL/路径的映射,用于将 Chrome 中的脚本解析为磁盘上的脚本", 16 | "chrome.runtimeExecutable.description": "要使用的运行时可执行文件的工作区绝对路径。如果未指定,则将从默认安装位置使用 Chrome。", 17 | "chrome.runtimeArgs.description": "传递给运行时可执行文件的可选参数。", 18 | "chrome.env.description": "环境键/值对的可选字典。", 19 | "chrome.cwd.description": "运行时可执行文件的可选工作目录。", 20 | "chrome.sourceMaps.description": "使用 JavaScript 源映射(如存在)。", 21 | "chrome.diagnosticLogging.description": "为 true 时,该适配器会将其自身诊断信息以人类可读格式记录到控制台", 22 | "chrome.verboseDiagnosticLogging.description": "为 true 时,适配器将记录客户端和目标的所有流量(以及由 diagnosticLogging 记录的信息)", 23 | "chrome.trace.description": "为 true 时,调试器将在文件中记录跟踪信息。为 verbose 时,还会在控制台中显示日志。", 24 | "chrome.userDataDir.description": "默认情况下,使用临时文件夹中的单独用户配置文件启动 Chrome 。使用此选项可替代它。设置为 false 可使用默认用户配置文件启动。", 25 | "chrome.sourceMapPathOverrides.description": "一组用于重写源映射中所述的源文件位置的映射,映射到磁盘上的相应位置。有关详细信息,请参见自述文件。", 26 | "chrome.smartStep.description": "自动单步运行源映射文件中未映射的行。例如,向下编译异步/等待或其他功能时,TypeScript 自动生成的代码。", 27 | "chrome.skipFiles.description": "文件或文件夹名称,或者路径 glob 的数组,在调试时跳过。", 28 | "chrome.timeout.description": "重试此毫秒数以连接到 Chrome。默认值为 10000 毫秒。", 29 | "chrome.disableNetworkCache.description": "控制是否跳过每个请求的网络缓存", 30 | "chrome.urlFilter.description": "将使用此 URL 搜索页面,找到后将连接到该页面。可使用 * 通配符。", 31 | "chrome.targetTypes.description": "可接受的目标类型的数组。默认值为 `[\"page\"]`。", 32 | "chrome.showAsyncStacks.description": "显示导致当前调用堆栈的异步调用。", 33 | "chrome.breakOnLoad.description": "实验性功能 - 如果为 true,则调试适配器将尝试在加载脚本之前在其中设置断点,使其可命中这些脚本开头之处的断点。性能会受到影响。", 34 | "chrome.breakOnLoadStrategy.description": "要用于 breakOnLoad 的策略。", 35 | "chrome.breakOnLoadStrategy.instrument.description": "指示 Chrome 在加载每个脚本时暂停,以便解析源映射并设置断点", 36 | "chrome.breakOnLoadStrategy.regex.description": "在与设置断点的文件名相同的文件中乐观地设置断点。" 37 | } -------------------------------------------------------------------------------- /i18n/cht/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "找不到 Chrome - 請予以安裝,或在啟動組態中設定 [runtimeExecutable] 欄位。" 8 | } -------------------------------------------------------------------------------- /i18n/cht/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "屬性 '{0}' 不存在 ('{1}')。" 8 | } -------------------------------------------------------------------------------- /i18n/cht/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "對 localhost 啟動 Chrome", 8 | "chrome.targets.placeholder": "選取索引標籤" 9 | } -------------------------------------------------------------------------------- /i18n/cht/package.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "extension.description": "在 Chrome 瀏覽器中或任何其他支援 Chrome 偵錯工具通訊協定的目標中偵錯 JavaScript 程式碼。", 8 | "chrome.toggleSkipping.title": "Chrome: 切換跳過此檔案", 9 | "chrome.toggleSmartStep.title": "Chrome: 切換智慧步驟", 10 | "chrome.port.description": "要用於 Chrome 遠端偵錯的連接埠。", 11 | "chrome.address.description": "偵錯連接埠的 TCP/IP 位址", 12 | "chrome.file.description": "要在瀏覽器中開啟的本機 html 檔案", 13 | "chrome.url.description": "將會搜尋具有此 EXACT URL 的索引標籤,若有找到,會附加至該索引標籤", 14 | "chrome.webRoot.description": "這會指定網頁伺服器根目錄的工作區絕對路徑。可用來將 `/app.js` 這類路徑解析成磁碟上的檔案。亦為 pathMapping 的 \"/\" 速記法", 15 | "chrome.pathMapping.description": "URL/路徑到本機資料夾的對應,用以將 Chrome 中的指令碼解析成磁碟上的指令碼", 16 | "chrome.runtimeExecutable.description": "要使用之執行階段可執行檔的工作區絕對路徑。若未指定,將會從預設安裝位置使用 Chrome。", 17 | "chrome.runtimeArgs.description": "傳遞至執行階段可執行檔的選用引數。", 18 | "chrome.env.description": "環境索引鍵/值組的選用字典。", 19 | "chrome.cwd.description": "執行階段可執行檔的選用工作目錄。", 20 | "chrome.sourceMaps.description": "使用 JavaScript 來源對應 (如果有)。", 21 | "chrome.diagnosticLogging.description": "若為 true,配接器會以人類看得懂的格式,將自己的診斷資訊記錄到主控台", 22 | "chrome.verboseDiagnosticLogging.description": "若為 true,配接器會記錄所有用戶端和目標的流量 (以及 'diagnosticLogging' 所記錄的資訊)", 23 | "chrome.trace.description": "若為 'true',偵錯工具會將追蹤資訊記錄到檔案。若為 'verbose',則也會在主控台中顯示記錄。", 24 | "chrome.userDataDir.description": "根據預設會使用暫存資料夾中的個別使用者設定檔啟動 Chrome。使用此選項可予以覆寫。設定為 false 可使用預設使用者設定檔啟動。", 25 | "chrome.sourceMapPathOverrides.description": "一組對應,用於將來源檔案的位置從 sourcemap 指出的位置重寫成磁碟上的位置。如需詳細資訊,請參閱讀我檔案。", 26 | "chrome.smartStep.description": "自動逐步執行 sourcemap 檔案中未對應的行。例如,TypeScript 在編譯 async/await 或其他功能時自動產生的程式碼。", 27 | "chrome.skipFiles.description": "偵錯時要跳過的檔案或資料夾名稱陣列或者路徑 Glob。", 28 | "chrome.timeout.description": "重試此毫秒數以連線到 Chrome。預設為 10000 毫秒。", 29 | "chrome.disableNetworkCache.description": "控制是否跳過每個要求的網路快取", 30 | "chrome.urlFilter.description": "將會搜尋具有此 URL 的頁面,若有找到,會附加至該頁面。可有 * 萬用字元。", 31 | "chrome.targetTypes.description": "可接受之目標類型的陣列。預設為 `[\"page\"]`。", 32 | "chrome.showAsyncStacks.description": "顯示造成目前呼叫堆疊的非同步呼叫", 33 | "chrome.breakOnLoad.description": "實驗性功能 - 如果為 true,偵錯配接器將會嘗試在載入指令碼前,先在其中設定中斷點,以便可在這些指令碼開頭叫用中斷點。這會影響效能。", 34 | "chrome.breakOnLoadStrategy.description": "要用於 breakOnLoad 的策略。", 35 | "chrome.breakOnLoadStrategy.instrument.description": "告知 Chrome 在載入每個指令碼時暫停,以解析 sourcemap 及設定中斷點", 36 | "chrome.breakOnLoadStrategy.regex.description": "在與中斷點設定所在檔案同名的檔案中,以開放模式設定中斷點。" 37 | } -------------------------------------------------------------------------------- /i18n/csy/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "Nepovedlo se najít Chrome – nainstalujte ho nebo v konfiguraci spuštění nastavte pole runtimeExecutable." 8 | } -------------------------------------------------------------------------------- /i18n/csy/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "Atribut {0} neexistuje ({1})." 8 | } -------------------------------------------------------------------------------- /i18n/csy/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "Spustit Chrome proti localhostu", 8 | "chrome.targets.placeholder": "Vyberte kartu." 9 | } -------------------------------------------------------------------------------- /i18n/deu/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "Chrome konnte nicht gefunden werden. Installieren Sie Chrome, oder legen Sie das Feld \"runtimeExecutable\" in der Startkonfigurationsdatei fest." 8 | } -------------------------------------------------------------------------------- /i18n/deu/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "Das Attribut \"{0}\" ist nicht vorhanden ({1})." 8 | } -------------------------------------------------------------------------------- /i18n/deu/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "Chrome mit \"localhost\" starten", 8 | "chrome.targets.placeholder": "Wählen Sie eine Registerkarte" 9 | } -------------------------------------------------------------------------------- /i18n/esn/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "No se encuentra Chrome. Instálelo o establezca el campo \"runtimeExecutable\" en la configuración de inicio." 8 | } -------------------------------------------------------------------------------- /i18n/esn/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "El atributo \"{0}\" no existe (\"{1}\")." 8 | } -------------------------------------------------------------------------------- /i18n/esn/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "Iniciar Chrome para localhost", 8 | "chrome.targets.placeholder": "Seleccione una pestaña" 9 | } -------------------------------------------------------------------------------- /i18n/fra/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "Chrome est introuvable. Installez-le ou définissez le champ \"runtimeExecutable\" dans la configuration de lancement." 8 | } -------------------------------------------------------------------------------- /i18n/fra/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "L'attribut '{0}' n'existe pas ('{1}')." 8 | } -------------------------------------------------------------------------------- /i18n/fra/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "Lancer Chrome en utilisant localhost", 8 | "chrome.targets.placeholder": "Sélectionner un onglet" 9 | } -------------------------------------------------------------------------------- /i18n/ita/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "Non è possibile trovare Chrome. Installarlo o impostare il campo \"runtimeExecutable\" nella configurazione di avvio." 8 | } -------------------------------------------------------------------------------- /i18n/ita/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "L'attributo '{0}' non esiste ('{1}')." 8 | } -------------------------------------------------------------------------------- /i18n/ita/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "Avvia Chrome con localhost", 8 | "chrome.targets.placeholder": "Selezionare una scheda" 9 | } -------------------------------------------------------------------------------- /i18n/jpn/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "Chrome が見つかりません - インストールするか、起動構成ファイルの \"runtimeExecutable\" フィールドを設定します。" 8 | } -------------------------------------------------------------------------------- /i18n/jpn/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "属性 '{0}' がありません ('{1}')。" 8 | } -------------------------------------------------------------------------------- /i18n/jpn/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "localhost に対して Chrome を起動する", 8 | "chrome.targets.placeholder": "タブを選択する" 9 | } -------------------------------------------------------------------------------- /i18n/kor/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "Chrome을 찾을 수 없음 - Chrome을 설치하거나 시작 구성의 \"runtimeExecutable\" 필드를 설정합니다." 8 | } -------------------------------------------------------------------------------- /i18n/kor/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "'{0}' 특성이 없습니다('{1}')." 8 | } -------------------------------------------------------------------------------- /i18n/kor/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "localhost에 대해 Chrome 시작", 8 | "chrome.targets.placeholder": "탭 선택" 9 | } -------------------------------------------------------------------------------- /i18n/kor/package.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "extension.description": "Chrome 브라우저 또는 Chrome 디버거 프로토콜을 지원하는 다른 대상에서 JavaScript 코드를 디버그합니다.", 8 | "chrome.toggleSkipping.title": "Chrome: 이 파일 건너뛰기 토글", 9 | "chrome.toggleSmartStep.title": "Chrome: 스마트 단계 토글", 10 | "chrome.port.description": "Chrome 원격 디버깅에 사용할 포트입니다.", 11 | "chrome.address.description": "디버그 포트의 TCP/IP 주소", 12 | "chrome.file.description": "브라우저에서 열 로컬 html 파일", 13 | "chrome.url.description": "이 정확한 URL이 있는 탭을 검색하고 해당 탭이 있는 경우 탭에 연결합니다.", 14 | "chrome.webRoot.description": "웹 서버 루트의 작업 영역 절대 경로를 지정합니다. 디스크의 파일에 대한 '/app.js' 같은 경로를 확인하는 데 사용됩니다. \"/\"의 pathMapping에 대한 축약형입니다.", 15 | "chrome.pathMapping.description": "Chrome에서 스크립트를 확인하기 위해 로컬 폴더의 URL/경로를 디스크의 스크립트에 매핑", 16 | "chrome.runtimeExecutable.description": "사용할 런타임 실행 파일의 작업 영역 절대 경로입니다. 지정하지 않으면 기본 설치 위치에서 Chrome이 사용됩니다.", 17 | "chrome.runtimeArgs.description": "런타임 실행 파일에 전달되는 선택적 인수입니다.", 18 | "chrome.env.description": "환경 키/값 쌍의 선택적 사전입니다.", 19 | "chrome.cwd.description": "런타임 실행 파일의 선택적 작업 디렉터리입니다.", 20 | "chrome.sourceMaps.description": "JavaScript 소스 맵을 사용합니다(있는 경우).", 21 | "chrome.diagnosticLogging.description": "true인 경우 어댑터가 자체 진단 정보를 사람이 읽을 수 있는 형식으로 콘솔에 로그합니다.", 22 | "chrome.verboseDiagnosticLogging.description": "true인 경우 어댑터가 'diagnosticLogging'에 의해 로그된 정보뿐만 아니라 클라이언트와 대상이 있는 모든 트래픽을 로그합니다.", 23 | "chrome.trace.description": "'true'인 경우 디버거가 추적 정보를 파일에 로그합니다. 'verbose'인 경우 로그를 콘솔에도 표시합니다.", 24 | "chrome.userDataDir.description": "기본적으로 Chrome은 임시 폴더에 있는 별도의 사용자 프로필로 시작됩니다. 재정의하려면 이 옵션을 사용하세요. 기본 사용자 프로필로 시작하려면 false로 설정하세요.", 25 | "chrome.sourceMapPathOverrides.description": "sourcemap의 위치에서 디스크의 위치로 소스 파일의 위치를 다시 작성하기 위한 매핑 세트입니다. 자세한 내용은 추가 정보를 참조하세요.", 26 | "chrome.smartStep.description": "소스 매핑된 파일의 매핑되지 않은 줄을 자동으로 단계별로 실행합니다. 이러한 줄의 예로는 async/await 또는 기타 기능을 다운 컴파일하는 경우 TypeScript에서 자동으로 생성하는 코드가 있습니다.", 27 | "chrome.skipFiles.description": "디버그할 때 건너뛸 파일 또는 폴더 이름이나 경로 GLOB의 배열입니다.", 28 | "chrome.timeout.description": "이 시간(밀리초) 동안 Chrome에 연결을 다시 시도합니다. 기본값은 10,000ms입니다.", 29 | "chrome.disableNetworkCache.description": "각 요청에 대한 네트워크 캐시를 건너뛸지 여부를 제어합니다.", 30 | "chrome.urlFilter.description": "이 URL로 페이지를 검색하고 해당 페이지가 있는 경우 페이지에 연결합니다. * 와일드카드를 사용할 수 있습니다.", 31 | "chrome.targetTypes.description": "허용되는 대상 유형의 배열입니다. 기본값은 '[\"page\"]'입니다.", 32 | "chrome.showAsyncStacks.description": "현재 호출 스택을 생성하는 비동기 호출을 표시합니다.", 33 | "chrome.breakOnLoad.description": "실험적 기능 - true인 경우 디버그 어댑터가 스크립트 시작 부분에 있는 중단점에 적중할 수 있도록 로드되기 전에 해당 스크립트에 중단점을 설정하려고 합니다. 이 기능을 사용하면 성능에 영향을 줍니다.", 34 | "chrome.breakOnLoadStrategy.description": "breakOnLoad에 사용할 전략입니다.", 35 | "chrome.breakOnLoadStrategy.instrument.description": "각 스크립트가 로드되면 Chrome에서 일시 중지한 후 sourcemap을 확인하고 중단점을 설정하도록 알려줍니다.", 36 | "chrome.breakOnLoadStrategy.regex.description": "중단점이 설정된 파일과 이름이 같은 파일에서 중단점을 최적으로 설정합니다." 37 | } -------------------------------------------------------------------------------- /i18n/plk/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "Nie można odnaleźć przeglądarki Chrome — zainstaluj ją lub ustaw pole „runtimeExecutable” w konfiguracji uruchamiania." 8 | } -------------------------------------------------------------------------------- /i18n/plk/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "Atrybut „{0}” nie istnieje („{1}”)." 8 | } -------------------------------------------------------------------------------- /i18n/plk/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "Uruchom przeglądarkę Chrome względem hosta lokalnego", 8 | "chrome.targets.placeholder": "Wybierz kartę" 9 | } -------------------------------------------------------------------------------- /i18n/ptb/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "Não é possível localizar o Chrome – instale-o ou defina o campo \"runtimeExecutable\" na configuração de inicialização." 8 | } -------------------------------------------------------------------------------- /i18n/ptb/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "O atributo '{0}' não existe ('{1}')." 8 | } -------------------------------------------------------------------------------- /i18n/ptb/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "Iniciar o Chrome em relação a localhost", 8 | "chrome.targets.placeholder": "Selecione uma guia" 9 | } -------------------------------------------------------------------------------- /i18n/rus/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "Не удается найти Chrome  — установите его или задайте значение поля \"runtimeExecutable\" в конфигурации запуска." 8 | } -------------------------------------------------------------------------------- /i18n/rus/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "Атрибут \"{0}\" не существует (\"{1}\")." 8 | } -------------------------------------------------------------------------------- /i18n/rus/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "Запустить Chrome на localhost", 8 | "chrome.targets.placeholder": "Перейдите на вкладку" 9 | } -------------------------------------------------------------------------------- /i18n/trk/out/src/chromeDebugAdapter.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.chrome.missing": "Chrome bulunamıyor. Chrome'u yükleyin veya başlatma yapılandırmasında \"runtimeExecutable\" alanını ayarlayın." 8 | } -------------------------------------------------------------------------------- /i18n/trk/out/src/errors.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "attribute.path.not.exist": "'{0}' özniteliği yok ('{1}')." 8 | } -------------------------------------------------------------------------------- /i18n/trk/out/src/extension.i18n.json: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | // Do not edit this file. It is machine generated. 6 | { 7 | "chrome.launch.name": "Chrome'u localhost'ta başlat", 8 | "chrome.targets.placeholder": "Sekme seçin" 9 | } -------------------------------------------------------------------------------- /images/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/vscode-chrome-debug/96f4e5001883bba776c58df86c39840a21a0c2ff/images/demo.gif -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/vscode-chrome-debug/96f4e5001883bba776c58df86c39840a21a0c2ff/images/icon.png -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/vscode-chrome-debug/96f4e5001883bba776c58df86c39840a21a0c2ff/images/screenshot.png -------------------------------------------------------------------------------- /msbuild/ChromeDebugAdapter.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | Microsoft400 26 | 27 | 28 | 29 | 30 | 31 | 32 | 0.2.0 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /msbuild/ChromeDebugAdapter.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27422.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChromeDebugAdapter", "ChromeDebugAdapter.csproj", "{FF72AE19-1081-4A1D-A2EA-EA50A3530289}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FF72AE19-1081-4A1D-A2EA-EA50A3530289}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {FF72AE19-1081-4A1D-A2EA-EA50A3530289}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {FF72AE19-1081-4A1D-A2EA-EA50A3530289}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {FF72AE19-1081-4A1D-A2EA-EA50A3530289}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {A0031A13-F520-495A-A28F-38294166BF6F} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /package.nls.ja.json: -------------------------------------------------------------------------------- 1 | { 2 | "extension.description": "Chrome ブラウザー、または Chrome Debugger プロトコルをサポートするその他のターゲットで JavaScript コードをデバッグします。", 3 | "chrome.toggleSkipping.title": "Chrome: このファイルのスキップを切り替え", 4 | "chrome.toggleSmartStep.title": "Chrome: スマート ステップを切り替え", 5 | "chrome.port.description": "Chrome リモート デバッグで使用するポートです。", 6 | "chrome.address.description": "デバッグ ポートの TCP/IP アドレス", 7 | "chrome.file.description": "ブラウザーで開くローカル HTML ファイル", 8 | "chrome.url.description": "これとまったく同じ URL のタブを検索し、見つかった場合はそれにアタッチします", 9 | "chrome.webRoot.description": "これは、Web サーバー ルートに対するワークスペースの絶対パスを指定します。ディスク上のファイルへの `/app.js` などのパスを解決するために使用されます。\"/\" は、pathMapping の短縮形です", 10 | "chrome.pathMapping.description": "Chrome 内のスクリプトをディスク上のスクリプトに解決する、URL/パスからローカル フォルダーへのマッピングです", 11 | "chrome.runtimeExecutable.description": "使用するランタイム実行可能ファイルへのワークスペース絶対パスです。指定しない場合、Chrome は既定のインストール場所から使用されます。", 12 | "chrome.runtimeArgs.description": "省略可能な引数がランタイム実行可能ファイルに渡されました。", 13 | "chrome.env.description": "環境キー/値のペアから成る省略可能なディクショナリです。", 14 | "chrome.cwd.description": "ランタイム実行可能ファイル用の省略可能な作業ディレクトリです。", 15 | "chrome.sourceMaps.description": "JavaScript ソース マップを使用します (存在する場合)。", 16 | "chrome.diagnosticLogging.description": "true の場合、アダプターは人が読める形式で独自の診断情報をコンソールに記録します", 17 | "chrome.verboseDiagnosticLogging.description": "true の場合、アダプターはクライアントおよびターゲットとのすべてのトラフィック (および 'diagnosticLogging' によって記録される情報) を記録します", 18 | "chrome.trace.description": "'true' の場合、デバッガーはトレース情報をファイルに記録します。'verbose' の場合、コンソールでのログの表示も行います。", 19 | "chrome.userDataDir.description": "既定では、Chrome は一時フォルダーの個別のユーザー プロファイルで起動されます。このオプションを使用するとそれをオーバーライドできます。既定のユーザー プロファイルで起動するには false に設定します。", 20 | "chrome.sourceMapPathOverrides.description": "ソース ファイルの場所をソースマップに指定されている内容からディスク上の場所へ書き換えるための一連のマッピング。詳しくは Readme をご覧ください。", 21 | "chrome.smartStep.description": "ソースマップ化されたファイル内のマッピングされていない行を自動的にステップ実行します。たとえば、async/await または他の機能をダウンコンパイルする際に TypeScript が自動的に生成するコードです。", 22 | "chrome.skipFiles.description": "デバッグ時にスキップする、ファイル名またはフォルダー名の配列、またはパス glob。", 23 | "chrome.timeout.description": "Chrome への接続を再試行する期間 (ミリ秒単位)。既定値は 10000 ミリ秒です。", 24 | "chrome.disableNetworkCache.description": "要求ごとのネットワーク キャッシュをスキップするかどうかを制御します", 25 | "chrome.urlFilter.description": "この URL のページを検索し、見つかった場合はそれにアタッチします。ワイルドカード * を使用できます。", 26 | "chrome.targetTypes.description": "使用可能なターゲット型の配列です。既定では、`[\"page\"]` です。", 27 | "chrome.showAsyncStacks.description": "現在の呼び出し履歴に至るまでの非同期呼び出しを表示します", 28 | "chrome.breakOnLoad.description": "試験的な機能 - true の場合、デバッグ アダプターによって読み込み前のスクリプトにブレークポイントの設定が試みられ、スクリプトの開始時からブレークポイントがヒットするようになります。これはパフォーマンスに影響します。", 29 | "chrome.breakOnLoadStrategy.description": "breakOnLoad に対して使用する方法。", 30 | "chrome.breakOnLoadStrategy.instrument.description": "各スクリプトが読み込まれる際に Chrome を一時停止し、ソースマップを解決してブレークポイントを設定します", 31 | "chrome.breakOnLoadStrategy.regex.description": "ブレークポイントが設定されているファイルと同じ名前を持つファイル内に、ブレークポイントをオプティミスティックに設定します。" 32 | } -------------------------------------------------------------------------------- /package.nls.ko.json: -------------------------------------------------------------------------------- 1 | { 2 | "extension.description": "Chrome 브라우저 또는 Chrome 디버거 프로토콜을 지원하는 다른 대상에서 JavaScript 코드를 디버그합니다.", 3 | "chrome.toggleSkipping.title": "Chrome: 이 파일 건너뛰기 토글", 4 | "chrome.toggleSmartStep.title": "Chrome: 스마트 단계 토글", 5 | "chrome.port.description": "Chrome 원격 디버깅에 사용할 포트입니다.", 6 | "chrome.address.description": "디버그 포트의 TCP/IP 주소", 7 | "chrome.file.description": "브라우저에서 열 로컬 html 파일", 8 | "chrome.url.description": "이 정확한 URL이 있는 탭을 검색하고 해당 탭이 있는 경우 탭에 연결합니다.", 9 | "chrome.webRoot.description": "웹 서버 루트의 작업 영역 절대 경로를 지정합니다. 디스크의 파일에 대한 '/app.js' 같은 경로를 확인하는 데 사용됩니다. \"/\"의 pathMapping에 대한 축약형입니다.", 10 | "chrome.pathMapping.description": "Chrome에서 스크립트를 확인하기 위해 로컬 폴더의 URL/경로를 디스크의 스크립트에 매핑", 11 | "chrome.runtimeExecutable.description": "사용할 런타임 실행 파일의 작업 영역 절대 경로입니다. 지정하지 않으면 기본 설치 위치에서 Chrome이 사용됩니다.", 12 | "chrome.runtimeArgs.description": "런타임 실행 파일에 전달되는 선택적 인수입니다.", 13 | "chrome.env.description": "환경 키/값 쌍의 선택적 사전입니다.", 14 | "chrome.cwd.description": "런타임 실행 파일의 선택적 작업 디렉터리입니다.", 15 | "chrome.sourceMaps.description": "JavaScript 소스 맵을 사용합니다(있는 경우).", 16 | "chrome.diagnosticLogging.description": "true인 경우 어댑터가 자체 진단 정보를 사람이 읽을 수 있는 형식으로 콘솔에 로그합니다.", 17 | "chrome.verboseDiagnosticLogging.description": "true인 경우 어댑터가 'diagnosticLogging'에 의해 로그된 정보뿐만 아니라 클라이언트와 대상이 있는 모든 트래픽을 로그합니다.", 18 | "chrome.trace.description": "'true'인 경우 디버거가 추적 정보를 파일에 로그합니다. 'verbose'인 경우 로그를 콘솔에도 표시합니다.", 19 | "chrome.userDataDir.description": "기본적으로 Chrome은 임시 폴더에 있는 별도의 사용자 프로필로 시작됩니다. 재정의하려면 이 옵션을 사용하세요. 기본 사용자 프로필로 시작하려면 false로 설정하세요.", 20 | "chrome.sourceMapPathOverrides.description": "sourcemap의 위치에서 디스크의 위치로 소스 파일의 위치를 다시 작성하기 위한 매핑 세트입니다. 자세한 내용은 추가 정보를 참조하세요.", 21 | "chrome.smartStep.description": "소스 매핑된 파일의 매핑되지 않은 줄을 자동으로 단계별로 실행합니다. 이러한 줄의 예로는 async/await 또는 기타 기능을 다운 컴파일하는 경우 TypeScript에서 자동으로 생성하는 코드가 있습니다.", 22 | "chrome.skipFiles.description": "디버그할 때 건너뛸 파일 또는 폴더 이름이나 경로 GLOB의 배열입니다.", 23 | "chrome.timeout.description": "이 시간(밀리초) 동안 Chrome에 연결을 다시 시도합니다. 기본값은 10,000ms입니다.", 24 | "chrome.disableNetworkCache.description": "각 요청에 대한 네트워크 캐시를 건너뛸지 여부를 제어합니다.", 25 | "chrome.urlFilter.description": "이 URL로 페이지를 검색하고 해당 페이지가 있는 경우 페이지에 연결합니다. * 와일드카드를 사용할 수 있습니다.", 26 | "chrome.targetTypes.description": "허용되는 대상 유형의 배열입니다. 기본값은 '[\"page\"]'입니다.", 27 | "chrome.showAsyncStacks.description": "현재 호출 스택을 생성하는 비동기 호출을 표시합니다.", 28 | "chrome.breakOnLoad.description": "실험적 기능 - true인 경우 디버그 어댑터가 스크립트 시작 부분에 있는 중단점에 적중할 수 있도록 로드되기 전에 해당 스크립트에 중단점을 설정하려고 합니다. 이 기능을 사용하면 성능에 영향을 줍니다.", 29 | "chrome.breakOnLoadStrategy.description": "breakOnLoad에 사용할 전략입니다.", 30 | "chrome.breakOnLoadStrategy.instrument.description": "각 스크립트가 로드되면 Chrome에서 일시 중지한 후 sourcemap을 확인하고 중단점을 설정하도록 알려줍니다.", 31 | "chrome.breakOnLoadStrategy.regex.description": "중단점이 설정된 파일과 이름이 같은 파일에서 중단점을 최적으로 설정합니다." 32 | } -------------------------------------------------------------------------------- /package.nls.zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "extension.description": "在 Chrome 浏览器或任何其他支持 Chrome 调试器协议的目标中调试 JavaScript 代码。", 3 | "chrome.toggleSkipping.title": "Chrome:“跳过此文件”开关", 4 | "chrome.toggleSmartStep.title": "Chrome:“智能步骤”开关", 5 | "chrome.port.description": "用于 Chrome 远程调试的端口。", 6 | "chrome.address.description": "调试端口的 TCP/IP 地址。", 7 | "chrome.file.description": "要在浏览器中打开的本地 HTML 文件", 8 | "chrome.url.description": "将使用此确切 URL 搜索标签,找到后将连接到该标签", 9 | "chrome.webRoot.description": "此设置指定 Web 服务器根的工作区绝对路径。用于将 `/app.js` 等路径解析为磁盘上的文件。pathMapping 的速记方式为 \"/\"", 10 | "chrome.pathMapping.description": "本地文件夹的 URL/路径的映射,用于将 Chrome 中的脚本解析为磁盘上的脚本", 11 | "chrome.runtimeExecutable.description": "要使用的运行时可执行文件的工作区绝对路径。如果未指定,则将从默认安装位置使用 Chrome。", 12 | "chrome.runtimeArgs.description": "传递给运行时可执行文件的可选参数。", 13 | "chrome.env.description": "环境键/值对的可选字典。", 14 | "chrome.cwd.description": "运行时可执行文件的可选工作目录。", 15 | "chrome.sourceMaps.description": "使用 JavaScript 源映射(如存在)。", 16 | "chrome.diagnosticLogging.description": "为 true 时,该适配器会将其自身诊断信息以人类可读格式记录到控制台", 17 | "chrome.verboseDiagnosticLogging.description": "为 true 时,适配器将记录客户端和目标的所有流量(以及由 diagnosticLogging 记录的信息)", 18 | "chrome.trace.description": "为 true 时,调试器将在文件中记录跟踪信息。为 verbose 时,还会在控制台中显示日志。", 19 | "chrome.userDataDir.description": "默认情况下,使用临时文件夹中的单独用户配置文件启动 Chrome 。使用此选项可替代它。设置为 false 可使用默认用户配置文件启动。", 20 | "chrome.sourceMapPathOverrides.description": "一组用于重写源映射中所述的源文件位置的映射,映射到磁盘上的相应位置。有关详细信息,请参见自述文件。", 21 | "chrome.smartStep.description": "自动单步运行源映射文件中未映射的行。例如,向下编译异步/等待或其他功能时,TypeScript 自动生成的代码。", 22 | "chrome.skipFiles.description": "文件或文件夹名称,或者路径 glob 的数组,在调试时跳过。", 23 | "chrome.timeout.description": "重试此毫秒数以连接到 Chrome。默认值为 10000 毫秒。", 24 | "chrome.disableNetworkCache.description": "控制是否跳过每个请求的网络缓存", 25 | "chrome.urlFilter.description": "将使用此 URL 搜索页面,找到后将连接到该页面。可使用 * 通配符。", 26 | "chrome.targetTypes.description": "可接受的目标类型的数组。默认值为 `[\"page\"]`。", 27 | "chrome.showAsyncStacks.description": "显示导致当前调用堆栈的异步调用。", 28 | "chrome.breakOnLoad.description": "实验性功能 - 如果为 true,则调试适配器将尝试在加载脚本之前在其中设置断点,使其可命中这些脚本开头之处的断点。性能会受到影响。", 29 | "chrome.breakOnLoadStrategy.description": "要用于 breakOnLoad 的策略。", 30 | "chrome.breakOnLoadStrategy.instrument.description": "指示 Chrome 在加载每个脚本时暂停,以便解析源映射并设置断点", 31 | "chrome.breakOnLoadStrategy.regex.description": "在与设置断点的文件名相同的文件中乐观地设置断点。" 32 | } -------------------------------------------------------------------------------- /package.nls.zh-tw.json: -------------------------------------------------------------------------------- 1 | { 2 | "extension.description": "在 Chrome 瀏覽器中或任何其他支援 Chrome 偵錯工具通訊協定的目標中偵錯 JavaScript 程式碼。", 3 | "chrome.toggleSkipping.title": "Chrome: 切換跳過此檔案", 4 | "chrome.toggleSmartStep.title": "Chrome: 切換智慧步驟", 5 | "chrome.port.description": "要用於 Chrome 遠端偵錯的連接埠。", 6 | "chrome.address.description": "偵錯連接埠的 TCP/IP 位址", 7 | "chrome.file.description": "要在瀏覽器中開啟的本機 html 檔案", 8 | "chrome.url.description": "將會搜尋具有此 EXACT URL 的索引標籤,若有找到,會附加至該索引標籤", 9 | "chrome.webRoot.description": "這會指定網頁伺服器根目錄的工作區絕對路徑。可用來將 `/app.js` 這類路徑解析成磁碟上的檔案。亦為 pathMapping 的 \"/\" 速記法", 10 | "chrome.pathMapping.description": "URL/路徑到本機資料夾的對應,用以將 Chrome 中的指令碼解析成磁碟上的指令碼", 11 | "chrome.runtimeExecutable.description": "要使用之執行階段可執行檔的工作區絕對路徑。若未指定,將會從預設安裝位置使用 Chrome。", 12 | "chrome.runtimeArgs.description": "傳遞至執行階段可執行檔的選用引數。", 13 | "chrome.env.description": "環境索引鍵/值組的選用字典。", 14 | "chrome.cwd.description": "執行階段可執行檔的選用工作目錄。", 15 | "chrome.sourceMaps.description": "使用 JavaScript 來源對應 (如果有)。", 16 | "chrome.diagnosticLogging.description": "若為 true,配接器會以人類看得懂的格式,將自己的診斷資訊記錄到主控台", 17 | "chrome.verboseDiagnosticLogging.description": "若為 true,配接器會記錄所有用戶端和目標的流量 (以及 'diagnosticLogging' 所記錄的資訊)", 18 | "chrome.trace.description": "若為 'true',偵錯工具會將追蹤資訊記錄到檔案。若為 'verbose',則也會在主控台中顯示記錄。", 19 | "chrome.userDataDir.description": "根據預設會使用暫存資料夾中的個別使用者設定檔啟動 Chrome。使用此選項可予以覆寫。設定為 false 可使用預設使用者設定檔啟動。", 20 | "chrome.sourceMapPathOverrides.description": "一組對應,用於將來源檔案的位置從 sourcemap 指出的位置重寫成磁碟上的位置。如需詳細資訊,請參閱讀我檔案。", 21 | "chrome.smartStep.description": "自動逐步執行 sourcemap 檔案中未對應的行。例如,TypeScript 在編譯 async/await 或其他功能時自動產生的程式碼。", 22 | "chrome.skipFiles.description": "偵錯時要跳過的檔案或資料夾名稱陣列或者路徑 Glob。", 23 | "chrome.timeout.description": "重試此毫秒數以連線到 Chrome。預設為 10000 毫秒。", 24 | "chrome.disableNetworkCache.description": "控制是否跳過每個要求的網路快取", 25 | "chrome.urlFilter.description": "將會搜尋具有此 URL 的頁面,若有找到,會附加至該頁面。可有 * 萬用字元。", 26 | "chrome.targetTypes.description": "可接受之目標類型的陣列。預設為 `[\"page\"]`。", 27 | "chrome.showAsyncStacks.description": "顯示造成目前呼叫堆疊的非同步呼叫", 28 | "chrome.breakOnLoad.description": "實驗性功能 - 如果為 true,偵錯配接器將會嘗試在載入指令碼前,先在其中設定中斷點,以便可在這些指令碼開頭叫用中斷點。這會影響效能。", 29 | "chrome.breakOnLoadStrategy.description": "要用於 breakOnLoad 的策略。", 30 | "chrome.breakOnLoadStrategy.instrument.description": "告知 Chrome 在載入每個指令碼時暫停,以解析 sourcemap 及設定中斷點", 31 | "chrome.breakOnLoadStrategy.regex.description": "在與中斷點設定所在檔案同名的檔案中,以開放模式設定中斷點。" 32 | } -------------------------------------------------------------------------------- /src/chromeDebug.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import * as nls from 'vscode-nls'; // MUST BE FIRST IMPORT 6 | nls.config({ bundleFormat: nls.BundleFormat.standalone }); 7 | 8 | import { ChromeDebugSession, logger, UrlPathTransformer, BaseSourceMapTransformer, telemetry } from 'vscode-chrome-debug-core'; 9 | import * as path from 'path'; 10 | import * as os from 'os'; 11 | import { defaultTargetFilter } from './utils'; 12 | 13 | import { ChromeDebugAdapter } from './chromeDebugAdapter'; 14 | import { ChromeProvidedPortConnection } from './chromeProvidedPortConnection'; 15 | 16 | const EXTENSION_NAME = 'debugger-for-chrome'; 17 | 18 | // Start a ChromeDebugSession configured to only match 'page' targets, which are Chrome tabs. 19 | // Cast because DebugSession is declared twice - in this repo's vscode-debugadapter, and that of -core... TODO 20 | ChromeDebugSession.run(ChromeDebugSession.getSession( 21 | { 22 | adapter: ChromeDebugAdapter, 23 | extensionName: EXTENSION_NAME, 24 | logFilePath: path.resolve(os.tmpdir(), 'vscode-chrome-debug.txt'), 25 | targetFilter: defaultTargetFilter, 26 | chromeConnection: ChromeProvidedPortConnection, 27 | pathTransformer: UrlPathTransformer, 28 | sourceMapTransformer: BaseSourceMapTransformer, 29 | })); 30 | 31 | /* tslint:disable:no-var-requires */ 32 | const debugAdapterVersion = require('../../package.json').version; 33 | logger.log(EXTENSION_NAME + ': ' + debugAdapterVersion); 34 | 35 | /* __GDPR__FRAGMENT__ 36 | "DebugCommonProperties" : { 37 | "Versions.DebugAdapter" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } 38 | } 39 | */ 40 | telemetry.telemetry.addCustomGlobalProperty({'Versions.DebugAdapter': debugAdapterVersion}); 41 | -------------------------------------------------------------------------------- /src/chromeDebugInterfaces.d.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import * as Core from 'vscode-chrome-debug-core'; 6 | import { DebugProtocol } from 'vscode-debugprotocol'; 7 | 8 | export interface ICommonRequestArgs extends Core.ICommonRequestArgs { 9 | webRoot?: string; 10 | disableNetworkCache?: boolean; 11 | targetTypes?: string[]; 12 | targetFilter?: Core.chromeConnection.ITargetFilter; 13 | urlFilter?: string; 14 | } 15 | 16 | export interface ILaunchRequestArgs extends Core.ILaunchRequestArgs, ICommonRequestArgs { 17 | runtimeArgs?: string[]; 18 | runtimeExecutable?: string; 19 | env?: { [key: string]: string; }; 20 | cwd?: string; 21 | file?: string; 22 | url?: string; 23 | stopOnEntry?: boolean; 24 | address?: string; 25 | port?: number; 26 | userDataDir?: string|boolean; 27 | breakOnLoad?: boolean; 28 | _clientOverlayPausedMessage?: string; 29 | shouldLaunchChromeUnelevated?: boolean; 30 | } 31 | 32 | export interface IAttachRequestArgs extends Core.IAttachRequestArgs, ICommonRequestArgs { 33 | } 34 | 35 | export interface ISetExpressionArgs { 36 | expression: string; 37 | value: string; 38 | frameId: number; 39 | format?: DebugProtocol.ValueFormat; 40 | timeout?: number; 41 | } 42 | 43 | export interface ISetExpressionResponseBody { 44 | value: string; 45 | } 46 | 47 | export interface VSDebugProtocolCapabilities extends DebugProtocol.Capabilities { 48 | supportsSetExpression?: boolean; 49 | } 50 | -------------------------------------------------------------------------------- /src/chromeSpawnHelper.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import * as cp from 'child_process'; 6 | 7 | const chromePath = process.argv[2]; 8 | const chromeArgs = process.argv.slice(3); 9 | 10 | console.log(`spawn('${chromePath}', ${JSON.stringify(chromeArgs) })`); 11 | const chromeProc = cp.spawn(chromePath, chromeArgs, { 12 | stdio: 'ignore', 13 | detached: true 14 | }); 15 | 16 | chromeProc.unref(); 17 | process.send(chromeProc.pid); 18 | -------------------------------------------------------------------------------- /src/errors.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import { DebugProtocol } from 'vscode-debugprotocol'; 6 | import { ErrorWithMessage } from 'vscode-chrome-debug-core/out/src/errors'; 7 | 8 | import * as nls from 'vscode-nls'; 9 | const localize = nls.loadMessageBundle(); 10 | 11 | /** 12 | * 'Path does not exist' error 13 | */ 14 | export function getNotExistErrorResponse(attribute: string, path: string): Promise { 15 | return Promise.reject(new ErrorWithMessage({ 16 | id: 2007, 17 | format: localize('attribute.path.not.exist', "Attribute '{0}' does not exist ('{1}').", attribute, '{path}'), 18 | variables: { path } 19 | })); 20 | } 21 | 22 | export function chromeProvidedPortWithoutUserDataDir() { 23 | return Promise.reject(new ErrorWithMessage({ 24 | id: 2008, 25 | format: localize('random.port.no.userdatadir', 'When the remote debugging port is set to 0, you must also provide the "userDataDir" launch argument'), 26 | sendTelemetry: true 27 | })); 28 | } 29 | 30 | export function couldNotConnectToPort(address: string, port: number) { 31 | return Promise.reject(new ErrorWithMessage({ 32 | id: 2008, 33 | format: localize('launch.port.not.open', 'Could not open a connection to Chrome at: {address}:{port}', '{address}', '{port}'), 34 | variables: { address, port: port.toString() }, 35 | sendTelemetry: true 36 | })); 37 | } -------------------------------------------------------------------------------- /src/launchUnelevated.js: -------------------------------------------------------------------------------- 1 | var objShell = new ActiveXObject("shell.application"); 2 | var objShellWindows = objShell.Windows(); 3 | if (objShellWindows != null) 4 | { 5 | var fso = new ActiveXObject("Scripting.FileSystemObject"); 6 | var tempFile = WScript.Arguments(0); 7 | var file = fso.OpenTextFile(tempFile, 2, true, 0); 8 | file.WriteLine(""); 9 | file.Close(); 10 | 11 | // Build up the parameters for launching the application and getting the process id 12 | var command = "cmd"; 13 | var params = "/c \"wmic /OUTPUT:\"" + tempFile + "\" process call create \""; 14 | for (var i = 1; i < WScript.Arguments.length; i++) { 15 | params += WScript.Arguments(i) + " "; 16 | } 17 | params += "\"\""; 18 | 19 | for (var i = 0; i < objShellWindows.count; i++) 20 | { 21 | var item = objShellWindows.Item(i); 22 | if (item) 23 | { 24 | item.Document.Application.ShellExecute(command, params); 25 | break; 26 | } 27 | } 28 | 29 | if (objShellWindows.count === 0) { 30 | // If no File Explorer windows are open fall-back to this alternative way of executing the command 31 | // See IShellWindows::FindWindowSW at https://msdn.microsoft.com/en-us/library/windows/desktop/cc836568(v=vs.85).aspx 32 | var item = objShellWindows.FindWindowSW(/*pvarLoc=NULL*/0, /*pvarLocRoot=NULL*/0, /*SWC_DESKTOP*/8, /*phwnd=NULL*/0, /*SWFO_NEEDDISPATCH*/1); 33 | item.Document.Application.ShellExecute(command, params); 34 | } 35 | } -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import * as path from 'path'; 6 | import { utils as coreUtils, chromeConnection } from 'vscode-chrome-debug-core'; 7 | 8 | const WIN_APPDATA = process.env.LOCALAPPDATA || '/'; 9 | const DEFAULT_CHROME_PATH = { 10 | LINUX: '/usr/bin/google-chrome', 11 | OSX: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', 12 | WIN: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', 13 | WIN_LOCALAPPDATA: path.join(WIN_APPDATA, 'Google\\Chrome\\Application\\chrome.exe'), 14 | WINx86: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', 15 | }; 16 | 17 | export function getBrowserPath(): string { 18 | const platform = coreUtils.getPlatform(); 19 | if (platform === coreUtils.Platform.OSX) { 20 | return coreUtils.existsSync(DEFAULT_CHROME_PATH.OSX) ? DEFAULT_CHROME_PATH.OSX : null; 21 | } else if (platform === coreUtils.Platform.Windows) { 22 | if (coreUtils.existsSync(DEFAULT_CHROME_PATH.WINx86)) { 23 | return DEFAULT_CHROME_PATH.WINx86; 24 | } else if (coreUtils.existsSync(DEFAULT_CHROME_PATH.WIN)) { 25 | return DEFAULT_CHROME_PATH.WIN; 26 | } else if (coreUtils.existsSync(DEFAULT_CHROME_PATH.WIN_LOCALAPPDATA)) { 27 | return DEFAULT_CHROME_PATH.WIN_LOCALAPPDATA; 28 | } else { 29 | return null; 30 | } 31 | } else { 32 | return coreUtils.existsSync(DEFAULT_CHROME_PATH.LINUX) ? DEFAULT_CHROME_PATH.LINUX : null; 33 | } 34 | } 35 | 36 | export class DebounceHelper { 37 | private waitToken: any; // TS can't decide whether Timer or number... 38 | 39 | constructor(private timeoutMs: number) { } 40 | 41 | /** 42 | * If not waiting already, call fn after the timeout 43 | */ 44 | public wait(fn: () => any): void { 45 | if (!this.waitToken) { 46 | this.waitToken = setTimeout(() => { 47 | this.waitToken = null; 48 | fn(); 49 | }, 50 | this.timeoutMs); 51 | } 52 | } 53 | 54 | /** 55 | * If waiting for something, cancel it and call fn immediately 56 | */ 57 | public doAndCancel(fn: () => any): void { 58 | if (this.waitToken) { 59 | clearTimeout(this.waitToken); 60 | this.waitToken = null; 61 | } 62 | 63 | fn(); 64 | } 65 | } 66 | 67 | export const getTargetFilter = (targetTypes?: string[]): chromeConnection.ITargetFilter => { 68 | if (targetTypes) { 69 | return target => target && (!target.type || targetTypes.indexOf(target.type) !== -1); 70 | } 71 | 72 | return () => true; 73 | }; 74 | 75 | export const defaultTargetFilter = getTargetFilter(['page']); 76 | -------------------------------------------------------------------------------- /test/int/README.md: -------------------------------------------------------------------------------- 1 | Integration tests. This folder contains tests that run (mostly) end-to-end tests with the debug adapter against an actual instance of Chrome. -------------------------------------------------------------------------------- /test/int/core-v2/chrome/collections/async.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | export function asyncMap(array: ReadonlyArray, 6 | callbackfn: (value: T, index: number, array: ReadonlyArray) => Promise | U, thisArg?: any): Promise { 7 | return Promise.all(array.map(callbackfn, thisArg)); 8 | } 9 | -------------------------------------------------------------------------------- /test/int/core-v2/chrome/collections/printing.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | /** Methods to print the contents of a collection for logging and debugging purposes (This is not intended for the end-user to see) */ 6 | export function printMap(typeDescription: string, map: { entries(): IterableIterator<[K, V]> }): string { 7 | const elementsPrinted = Array.from(map.entries()).map(entry => `${entry[0]}: ${entry[1]}`).join('; '); 8 | return `${typeDescription} { ${elementsPrinted} }`; 9 | } 10 | 11 | export function printSet(typeDescription: string, set: Set): string { 12 | const elementsPrinted = printElements(Array.from(set), '; '); 13 | return `${typeDescription} { ${elementsPrinted} }`; 14 | } 15 | 16 | export function printArray(typeDescription: string, elements: T[]): string { 17 | const elementsPrinted = printElements(elements, ', '); 18 | return typeDescription ? `${typeDescription} [ ${elementsPrinted} ]` : `[ ${elementsPrinted} ]`; 19 | } 20 | 21 | export function printIterable(typeDescription: string, iterable: IterableIterator): string { 22 | const elementsPrinted = printElements(Array.from(iterable), '; '); 23 | return `${typeDescription} { ${elementsPrinted} }`; 24 | } 25 | 26 | function printElements(elements: T[], separator = '; '): string { 27 | return elements.map(element => `${element}`).join(separator); 28 | } -------------------------------------------------------------------------------- /test/int/core-v2/chrome/collections/utilities.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import { ValidatedMultiMap } from './validatedMultiMap'; 6 | 7 | export function groupByKey(elements: T[], obtainKey: (element: T) => K): ValidatedMultiMap { 8 | const grouped = ValidatedMultiMap.empty(); 9 | elements.forEach(element => grouped.add(obtainKey(element), element)); 10 | return grouped; 11 | } 12 | 13 | export function determineOrderingOfStrings(left: string, right: string): number { 14 | if (left < right) { 15 | return -1; 16 | } else if (left > right) { 17 | return 1; 18 | } else { 19 | return 0; 20 | } 21 | } 22 | 23 | export function singleElementOfArray(array: ReadonlyArray): T { 24 | if (array.length === 1) { 25 | return array[0]; 26 | } else { 27 | throw new Error(`Expected array ${array} to have exactly a single element yet it had ${array.length}`); 28 | } 29 | } -------------------------------------------------------------------------------- /test/int/core-v2/chrome/collections/validatedSet.ts: -------------------------------------------------------------------------------- 1 | import { printSet } from './printing'; 2 | import { breakWhileDebugging } from '../../validation'; 3 | 4 | export interface IValidatedSet extends Set { 5 | addOrReplaceIfExists(key: K): this; 6 | deleteIfExists(key: K): boolean; 7 | toArray(): K[]; 8 | } 9 | 10 | /** A set that throws exceptions instead of returning error codes. */ 11 | export class ValidatedSet implements IValidatedSet { 12 | private readonly _wrappedSet: Set; 13 | 14 | public constructor(); 15 | public constructor(iterable: Iterable); 16 | public constructor(values?: ReadonlyArray); 17 | public constructor(valuesOrIterable?: ReadonlyArray | undefined | Iterable) { 18 | this._wrappedSet = valuesOrIterable 19 | ? new Set(valuesOrIterable) 20 | : new Set(); 21 | } 22 | 23 | public get size(): number { 24 | return this._wrappedSet.size; 25 | } 26 | 27 | public get [Symbol.toStringTag](): 'Set' { 28 | return 'ValidatedSet' as 'Set'; 29 | } 30 | 31 | public clear(): void { 32 | this._wrappedSet.clear(); 33 | } 34 | 35 | public delete(key: K): boolean { 36 | if (!this._wrappedSet.delete(key)) { 37 | breakWhileDebugging(); 38 | throw new Error(`Couldn't delete element with key ${key} because it wasn't present in the set`); 39 | } 40 | 41 | return true; 42 | } 43 | 44 | public deleteIfExists(key: K): boolean { 45 | return this._wrappedSet.delete(key); 46 | } 47 | 48 | public forEach(callbackfn: (key: K, sameKeyAgain: K, set: Set) => void, thisArg?: any): void { 49 | this._wrappedSet.forEach(callbackfn, thisArg); 50 | } 51 | 52 | public has(key: K): boolean { 53 | return this._wrappedSet.has(key); 54 | } 55 | 56 | public add(key: K): this { 57 | if (this.has(key)) { 58 | breakWhileDebugging(); 59 | throw new Error(`Cannot add key ${key} because it already exists`); 60 | } 61 | 62 | return this.addOrReplaceIfExists(key); 63 | } 64 | 65 | public addOrReplaceIfExists(key: K): this { 66 | this._wrappedSet.add(key); 67 | return this; 68 | } 69 | 70 | [Symbol.iterator](): IterableIterator { 71 | return this._wrappedSet[Symbol.iterator](); 72 | } 73 | 74 | public entries(): IterableIterator<[K, K]> { 75 | return this._wrappedSet.entries(); 76 | } 77 | 78 | public keys(): IterableIterator { 79 | return this._wrappedSet.keys(); 80 | } 81 | 82 | public values(): IterableIterator { 83 | return this._wrappedSet.values(); 84 | } 85 | 86 | public toString(): string { 87 | return printSet('ValidatedSet', this); 88 | } 89 | 90 | public toArray(): K[] { 91 | return Array.from(this); 92 | } 93 | } -------------------------------------------------------------------------------- /test/int/core-v2/chrome/internal/breakpoints/bpActionWhenHit.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import { IEquivalenceComparable } from '../../utils/equivalence'; 6 | 7 | /** 8 | * These classes represents the different actions that a breakpoint can take when hit 9 | * Breakpoint: AlwaysPause 10 | * Conditional Breakpoint: ConditionalPause 11 | * Logpoint: LogMessage 12 | * Hit Count Breakpoint: PauseOnHitCount 13 | */ 14 | export interface IBPActionWhenHit extends IEquivalenceComparable { 15 | isEquivalentTo(bpActionWhenHit: IBPActionWhenHit): boolean; 16 | } 17 | 18 | export class AlwaysPause implements IBPActionWhenHit { 19 | public isEquivalentTo(bpActionWhenHit: IBPActionWhenHit): boolean { 20 | return bpActionWhenHit instanceof AlwaysPause; 21 | } 22 | 23 | public toString(): string { 24 | return 'always pause'; 25 | } 26 | } 27 | 28 | export class ConditionalPause implements IBPActionWhenHit { 29 | constructor(public readonly expressionOfWhenToPause: string) { } 30 | 31 | public isEquivalentTo(bpActionWhenHit: IBPActionWhenHit): boolean { 32 | return (bpActionWhenHit instanceof ConditionalPause) 33 | && this.expressionOfWhenToPause === bpActionWhenHit.expressionOfWhenToPause; 34 | } 35 | 36 | public toString(): string { 37 | return `pause if: ${this.expressionOfWhenToPause}`; 38 | } 39 | } 40 | 41 | export class PauseOnHitCount implements IBPActionWhenHit { 42 | constructor(public readonly pauseOnHitCondition: string) { } 43 | 44 | public isEquivalentTo(bpActionWhenHit: IBPActionWhenHit): boolean { 45 | return (bpActionWhenHit instanceof PauseOnHitCount) 46 | && this.pauseOnHitCondition === bpActionWhenHit.pauseOnHitCondition; 47 | } 48 | 49 | public toString(): string { 50 | return `pause when hits: ${this.pauseOnHitCondition}`; 51 | } 52 | } 53 | 54 | export class LogMessage implements IBPActionWhenHit { 55 | constructor(public readonly expressionToLog: string) { } 56 | 57 | public isEquivalentTo(bpActionWhenHit: IBPActionWhenHit): boolean { 58 | return (bpActionWhenHit instanceof LogMessage) 59 | && this.expressionToLog === bpActionWhenHit.expressionToLog; 60 | } 61 | 62 | public toString(): string { 63 | return `log: ${this.expressionToLog}`; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /test/int/core-v2/chrome/internal/locations/location.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import * as Validation from '../../../validation'; 6 | import { ColumnNumber, LineNumber, createLineNumber, createColumnNumber } from './subtypes'; 7 | import { IEquivalenceComparable } from '../../utils/equivalence'; 8 | import * as _ from 'lodash'; 9 | 10 | export type integer = number; 11 | 12 | export class Position implements IEquivalenceComparable { 13 | public static readonly origin = new Position(createLineNumber(0), createColumnNumber(0)); 14 | 15 | constructor( 16 | public readonly lineNumber: LineNumber, 17 | public readonly columnNumber: ColumnNumber) { 18 | Validation.zeroOrPositive('Line number', lineNumber); 19 | if (columnNumber !== undefined) { 20 | Validation.zeroOrPositive('Column number', columnNumber); 21 | } 22 | } 23 | 24 | public static appearingLastOf(...positions: Position[]): Position { 25 | const lastPosition = _.reduce(positions, (left, right) => left.doesAppearBefore(right) ? right : left); 26 | if (lastPosition !== undefined) { 27 | return lastPosition; 28 | } else { 29 | throw new Error(`Couldn't find the position appearing last from the list: ${positions}. Is it possible the list was empty?`); 30 | } 31 | } 32 | 33 | public static appearingFirstOf(...positions: Position[]): Position { 34 | const firstPosition = _.reduce(positions, (left, right) => left.doesAppearBefore(right) ? left : right); 35 | if (firstPosition !== undefined) { 36 | return firstPosition; 37 | } else { 38 | throw new Error(`Couldn't find the position appearing first from the list: ${positions}. Is it possible the list was empty?`); 39 | } 40 | } 41 | 42 | public static isBetween(start: Position, maybeInBetween: Position, end: Position): boolean { 43 | return !maybeInBetween.doesAppearBefore(start) && !end.doesAppearBefore(maybeInBetween); 44 | } 45 | 46 | public isEquivalentTo(location: Position): boolean { 47 | return this.lineNumber === location.lineNumber 48 | && this.columnNumber === location.columnNumber; 49 | } 50 | 51 | public isOrigin(): boolean { 52 | return this.lineNumber === 0 && (this.columnNumber === undefined || this.columnNumber === 0); 53 | } 54 | 55 | public doesAppearBefore(right: Position): boolean { 56 | return this.lineNumber < right.lineNumber || 57 | (this.lineNumber === right.lineNumber && this.columnNumber < right.columnNumber); 58 | } 59 | 60 | public toString(): string { 61 | return this.columnNumber !== undefined 62 | ? `${this.lineNumber}:${this.columnNumber}` 63 | : `${this.lineNumber}`; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /test/int/core-v2/chrome/internal/locations/subtypes.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | // We use these types to have the compiler check that we are not sending a ColumnNumber where a LineNumber is expected 6 | 7 | const lineIndexSymbol = Symbol(); 8 | export type LineNumber = number & { [lineIndexSymbol]: true }; 9 | 10 | export function createLineNumber(numberRepresentation: number): LineNumber { 11 | return numberRepresentation; 12 | } 13 | 14 | const columnIndexSymbol = Symbol(); 15 | export type ColumnNumber = number & { [columnIndexSymbol]: true }; 16 | 17 | export function createColumnNumber(numberRepresentation: number): ColumnNumber { 18 | return numberRepresentation; 19 | } 20 | 21 | const URLRegexpSymbol = Symbol(); 22 | export type URLRegexp = string & { [URLRegexpSymbol]: true }; 23 | 24 | export function createURLRegexp(textRepresentation: string): URLRegexp { 25 | return textRepresentation; 26 | } -------------------------------------------------------------------------------- /test/int/core-v2/chrome/utils/equivalence.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | export interface IEquivalenceComparable { 6 | isEquivalentTo(right: this): boolean; 7 | } -------------------------------------------------------------------------------- /test/int/core-v2/typeUtils.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | /** 6 | * Type utilities to construct derived types from the original types, rather than have to manually write them 7 | */ 8 | export type MakePropertyRequired = T & { [P in K]-?: T[K] }; 9 | export type RemoveProperty = Pick>; 10 | export type SpecializeProperty = T & { [P in K]: S }; 11 | 12 | export function isNotUndefined(object: T | undefined): object is T { 13 | return object !== undefined; 14 | } 15 | 16 | export interface Array { 17 | filter(predicate: (element: T) => element is U): U[]; 18 | } 19 | 20 | export type Replace = { 21 | [K in keyof T]: K extends R ? N : T[K]; 22 | }; 23 | -------------------------------------------------------------------------------- /test/int/core-v2/validation.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | export function zeroOrPositive(name: string, value: number) { 6 | if (value < 0) { 7 | breakWhileDebugging(); 8 | throw new Error(`Expected ${name} to be either zero or a positive number and instead it was ${value}`); 9 | } 10 | } 11 | 12 | /** Used for debugging while developing to automatically break when something unexpected happened */ 13 | export function breakWhileDebugging() { 14 | if (process.env.BREAK_WHILE_DEBUGGING === 'true') { 15 | // tslint:disable-next-line:no-debugger 16 | debugger; 17 | } 18 | } 19 | 20 | export function notNullNorUndefinedElements(name: string, array: unknown[]): void { 21 | const index = array.findIndex(element => element === null || element === undefined); 22 | if (index >= 0) { 23 | breakWhileDebugging(); 24 | throw new Error(`Expected ${name} to not have any null or undefined elements, yet the element at #${index} was ${array[index]}`); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/int/featureBasedSuits/inlineScripts.test.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | import * as testSetup from '../testSetup'; 5 | import { puppeteerSuite } from '../puppeteer/puppeteerSuite'; 6 | import { TestProjectSpec } from '../framework/frameworkTestSupport'; 7 | import { FrameworkTestSuite } from '../framework/frameworkCommonTests'; 8 | import * as path from 'path'; 9 | import { utils } from 'vscode-chrome-debug-core'; 10 | 11 | const SINGLE_INLINE_TEST_SPEC = TestProjectSpec.fromTestPath('inline_scripts', '', utils.pathToFileURL(path.join(testSetup.DATA_ROOT, 'inline_scripts/single.html'))); 12 | const MULTIPLE_INLINE_TEST_SPEC = TestProjectSpec.fromTestPath('inline_scripts', '', utils.pathToFileURL(path.join(testSetup.DATA_ROOT, 'inline_scripts/multiple.html'))); 13 | 14 | suite('Inline Script Tests', () => { 15 | puppeteerSuite('Single inline script', SINGLE_INLINE_TEST_SPEC, (suiteContext) => { 16 | const frameworkTests = new FrameworkTestSuite('Simple JS', suiteContext); 17 | frameworkTests.testBreakpointHitsOnPageAction('Should stop on a breakpoint in an in-line script', '#actionButton', 'single.html', 'a + b;', page => page.click('#actionButton') ); 18 | }); 19 | 20 | puppeteerSuite.skip('Multiple inline scripts', MULTIPLE_INLINE_TEST_SPEC, (suiteContext) => { 21 | const frameworkTests = new FrameworkTestSuite('Simple JS', suiteContext); 22 | frameworkTests.testBreakpointHitsOnPageAction('Should stop on a breakpoint in multiple in-line scripts (Skipped, not currently working in V2)', 23 | '#actionButton', 'multiple.html', 'inlineScript1', page => page.click('#actionButton') ); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /test/int/fixtures/defaultFixture.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import { IFixture } from './fixture'; 6 | import { ExtendedDebugClient } from 'vscode-chrome-debug-core-testsupport'; 7 | import * as testSetup from '../testSetup'; 8 | import { IBeforeAndAfterContext, ITestCallbackContext } from 'mocha'; 9 | import { logger } from 'vscode-debugadapter'; 10 | 11 | /** 12 | * Default set up for all our tests. We expect all our tests to need to do this setup 13 | * which includes configure the debug adapter, logging, etc... 14 | */ 15 | export class DefaultFixture implements IFixture { 16 | private constructor(public readonly debugClient: ExtendedDebugClient) { 17 | // Running tests on CI can time out at the default 5s, so we up this to 15s 18 | debugClient.defaultTimeout = 15000; 19 | } 20 | 21 | /** Create a new fixture using the provided setup context */ 22 | public static async create(context: IBeforeAndAfterContext | ITestCallbackContext): Promise { 23 | return new DefaultFixture(await testSetup.setup(context)); 24 | } 25 | 26 | /** Create a new fixture using the full title of the test case currently running */ 27 | public static async createWithTitle(testTitle: string): Promise { 28 | return new DefaultFixture(await testSetup.setupWithTitle(testTitle)); 29 | } 30 | 31 | public async cleanUp(): Promise { 32 | logger.log(`Default test clean-up`); 33 | await testSetup.teardown(); 34 | logger.log(`Default test clean-up finished`); 35 | } 36 | 37 | public toString(): string { 38 | return `DefaultFixture`; 39 | } 40 | } -------------------------------------------------------------------------------- /test/int/fixtures/fixture.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import { PromiseOrNot } from 'vscode-chrome-debug-core'; 6 | 7 | /** 8 | * See https://en.wikipedia.org/wiki/Test_fixture for more context 9 | */ 10 | 11 | /** 12 | * A fixture represents a particular piece of set up of the context, or the environment or 13 | * the configuration needed for a test or suite to run. 14 | * The fixture should make those changes during it's constructor or static constructor method, 15 | * and it'll "clean up" those changes with the cleanUp method 16 | */ 17 | export interface IFixture { 18 | /** Clean-up the context, or changes made by the fixture */ 19 | cleanUp(): PromiseOrNot; 20 | } 21 | 22 | /** 23 | * A fixture representing that no setup is needed 24 | */ 25 | export class NullFixture implements IFixture { 26 | public cleanUp(): void { } 27 | } 28 | -------------------------------------------------------------------------------- /test/int/fixtures/multipleFixtures.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import { IFixture } from './fixture'; 6 | import { asyncMap } from '../core-v2/chrome/collections/async'; 7 | 8 | /** Combine multiple fixtures into a single fixture, for easier management (e.g. you just need to call a single cleanUp method) */ 9 | export class MultipleFixtures implements IFixture { 10 | private readonly _fixtures: IFixture[]; 11 | 12 | public constructor(...fixtures: IFixture[]) { 13 | this._fixtures = fixtures; 14 | } 15 | 16 | public async cleanUp(): Promise { 17 | await asyncMap(this._fixtures, fixture => fixture.cleanUp()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/int/fixtures/testUsing.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import { IFixture } from './fixture'; 6 | import { PromiseOrNot } from 'vscode-chrome-debug-core'; 7 | import { ITestCallbackContext } from 'mocha'; 8 | 9 | /** Run a test doing the setup/cleanup indicated by the provided fixtures */ 10 | function testUsingFunction( 11 | expectation: string, 12 | fixtureProvider: (context: ITestCallbackContext) => PromiseOrNot, 13 | testFunction: (fixtures: T) => Promise): Mocha.ITest { 14 | return test(expectation, async function () { 15 | const fixture = await fixtureProvider(this); 16 | try { 17 | await testFunction(fixture); 18 | } finally { 19 | await fixture.cleanUp(); 20 | } 21 | }); 22 | } 23 | 24 | export const testUsing = testUsingFunction; 25 | -------------------------------------------------------------------------------- /test/int/framework/README.md: -------------------------------------------------------------------------------- 1 | This folder contains tests that apply to specific frameworks or project types (e.g. React, Angular, Vue, etc.) -------------------------------------------------------------------------------- /test/int/framework/framework.support.test.ts: -------------------------------------------------------------------------------- 1 | import { loadProjectLabels } from '../labels'; 2 | import { expect } from 'chai'; 3 | import * as path from 'path'; 4 | 5 | suite('Test framework tests', () => { 6 | test('Should correctly find breakpoint labels in test source files', async () => { 7 | let labels = await loadProjectLabels('./testdata'); 8 | let worldLabel = labels.get('WorldLabel'); 9 | 10 | expect(worldLabel.path).to.eql(path.join('testdata', 'labelTest.ts')); 11 | expect(worldLabel.line).to.eql(9); 12 | }); 13 | 14 | test('Should correctly find block comment breakpoint labels in test source files', async () => { 15 | let labels = await loadProjectLabels('./testdata'); 16 | let blockLabel = labels.get('blockLabel'); 17 | 18 | expect(blockLabel.path).to.eql(path.join('testdata', 'labelTest.ts')); 19 | expect(blockLabel.line).to.eql(10); 20 | }); 21 | }); -------------------------------------------------------------------------------- /test/int/intTestSupport.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | /* 7 | * This file contains support functions to make integration testing easier 8 | */ 9 | 10 | import { DebugClient } from 'vscode-debugadapter-testsupport'; 11 | 12 | const ImplementsBreakpointLocation = Symbol(); 13 | /** 14 | * Simple breakpoint location params (based on what the debug test client accepts) 15 | */ 16 | export class BreakpointLocation { 17 | [ImplementsBreakpointLocation]: 'BreakpointLocation'; 18 | 19 | public constructor ( 20 | /** The path to the source file in which to set a breakpoint */ 21 | public readonly path: string, 22 | /** The line number in the file to set a breakpoint on */ 23 | public readonly line: number, 24 | /** Optional breakpoint column */ 25 | public readonly column?: number, 26 | /** Whether or not we should assert if the bp is verified or not */ 27 | public readonly verified?: boolean) {} 28 | 29 | public toString(): string { 30 | return `${this.path}:${this.line}:${this.column} verified: ${this.verified}`; 31 | } 32 | } 33 | 34 | /** 35 | * Launch an instance of chrome and wait for the debug adapter to initialize and attach 36 | * @param client Debug Client 37 | * @param launchConfig The launch config to use 38 | */ 39 | export async function launchTestAdapter(client: DebugClient, launchConfig: any) { 40 | 41 | let init = client.waitForEvent('initialized'); 42 | await client.launch(launchConfig); 43 | await init; 44 | await client.configurationDoneRequest(); 45 | } 46 | 47 | /** 48 | * Easier way to set breakpoints for testing 49 | * @param client DebugClient 50 | * @param location Breakpoint location 51 | */ 52 | export function setBreakpoint(client: DebugClient, location: { path: string, line: number, column?: number, verified?: boolean }) { 53 | return client.setBreakpointsRequest({ 54 | lines: [location.line], 55 | breakpoints: [{ line: location.line, column: location.column }], 56 | source: { path: location.path } 57 | }); 58 | } 59 | 60 | /** 61 | * Set a conditional breakpoint in a file 62 | * @param client DebugClient 63 | * @param location Desired breakpoint location 64 | * @param condition The condition on which the breakpoint should be hit 65 | */ 66 | export function setConditionalBreakpoint(client: DebugClient, location: { path: string, line: number, column?: number, verified?: boolean }, condition: string) { 67 | return client.setBreakpointsRequest({ 68 | lines: [location.line], 69 | breakpoints: [{ line: location.line, column: location.column, condition }], 70 | source: { path: location.path } 71 | }); 72 | } 73 | -------------------------------------------------------------------------------- /test/int/puppeteer/README.md: -------------------------------------------------------------------------------- 1 | Functions and test suite extensions to run integration tests with puppeteer on Chrome. -------------------------------------------------------------------------------- /test/int/puppeteer/launchPuppeteer.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import * as getPort from 'get-port'; 6 | import { IFixture } from '../fixtures/fixture'; 7 | import { launchTestAdapter } from '../intTestSupport'; 8 | import { ExtendedDebugClient } from 'vscode-chrome-debug-core-testsupport'; 9 | import { connectPuppeteer, getPageByUrl } from './puppeteerSupport'; 10 | import { logCallsTo } from '../utils/logging'; 11 | import { isThisV1 } from '../testSetup'; 12 | import { Browser, Page } from 'puppeteer'; 13 | import { ILaunchRequestArgs } from 'vscode-chrome-debug-core'; 14 | import { logger } from 'vscode-debugadapter'; 15 | 16 | /** 17 | * Launch the debug adapter using the Puppeteer version of chrome, and then connect to it 18 | * 19 | * The fixture offers access to both the browser, and page objects of puppeteer 20 | */ 21 | export class LaunchPuppeteer implements IFixture { 22 | public constructor(public readonly browser: Browser, public readonly page: Page) { } 23 | 24 | public static async create(debugClient: ExtendedDebugClient, launchConfig: any /* TODO: investigate why launch config types differ between V1 and V2 */): Promise { 25 | const daPort = await getPort(); 26 | logger.log(`About to launch debug-adapter at port: ${daPort}`); 27 | await launchTestAdapter(debugClient, Object.assign({}, launchConfig, { port: daPort })); 28 | const browser = await connectPuppeteer(daPort); 29 | 30 | const page = logCallsTo(await getPageByUrl(browser, launchConfig.url!), 'PuppeteerPage'); 31 | 32 | // This short wait appears to be necessary to completely avoid a race condition in V1 (tried several other 33 | // strategies to wait deterministically for all scripts to be loaded and parsed, but have been unsuccessful so far) 34 | // If we don't wait here, there's always a possibility that we can send the set breakpoint request 35 | // for a subsequent test after the scripts have started being parsed/run by Chrome, yet before 36 | // the target script is parsed, in which case the adapter will try to use breakOnLoad, but 37 | // the instrumentation BP will never be hit, leaving our breakpoint in limbo 38 | if (isThisV1) { 39 | await new Promise(a => setTimeout(a, 500)); 40 | } 41 | 42 | return new LaunchPuppeteer(browser, page); 43 | } 44 | 45 | public async cleanUp(): Promise { 46 | logger.log(`Closing puppeteer and chrome`); 47 | try { 48 | await this.browser.close(); 49 | logger.log(`Scucesfully closed puppeteer and chrome`); 50 | } catch (exception) { 51 | logger.log(`Failed to close puppeteer: ${exception}`); 52 | } 53 | } 54 | 55 | 56 | public toString(): string { 57 | return `LaunchPuppeteer`; 58 | } 59 | } -------------------------------------------------------------------------------- /test/int/puppeteer/puppeteerSupport.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | /* 7 | * Functions that make puppeteer testing easier 8 | */ 9 | 10 | import * as request from 'request-promise-native'; 11 | import * as puppeteer from 'puppeteer'; 12 | 13 | /** 14 | * Connect puppeteer to a currently running instance of chrome 15 | * @param port The port on which the chrome debugger is running 16 | */ 17 | export async function connectPuppeteer(port: number): Promise { 18 | 19 | const resp = await request(`http://localhost:${port}/json/version`); 20 | const { webSocketDebuggerUrl } = JSON.parse(resp); 21 | 22 | const browser = await puppeteer.connect({ browserWSEndpoint: webSocketDebuggerUrl, defaultViewport: null }); 23 | return browser; 24 | } 25 | 26 | /** 27 | * Get the first (or only) page loaded in chrome 28 | * @param browser Puppeteer browser object 29 | */ 30 | export async function firstPage(browser: puppeteer.Browser): Promise { 31 | return (await browser.pages())[0]; 32 | } 33 | 34 | /** 35 | * Get a page in the browser by the url 36 | * @param browser Puppeteer browser object 37 | * @param url The url of the desired page 38 | * @param timeout Timeout in milliseconds 39 | */ 40 | export async function getPageByUrl(browser: puppeteer.Browser, url: string, timeout = 5000): Promise { 41 | 42 | let before = new Date().getTime(); 43 | let current = before; 44 | 45 | // poll for the desired page url. If we don't find it within the timeout, throw an error 46 | while ((current - before) < timeout) { 47 | 48 | const pages = await browser.pages(); 49 | const desiredPage = pages.find(p => p.url().toLowerCase() === url.toLowerCase()); 50 | if (desiredPage) { 51 | return desiredPage; 52 | } 53 | 54 | // TODO: yuck, clean up 55 | await new Promise((a, _r) => setTimeout(() => a(), timeout / 10)); 56 | current = new Date().getTime(); 57 | } 58 | throw `Page with url: ${url} could not be found within ${timeout}ms`; 59 | } 60 | -------------------------------------------------------------------------------- /test/int/puppeteer/puppeteerTypeFix.d.ts: -------------------------------------------------------------------------------- 1 | // Needed to make @types/puppeteer pass type checking 2 | // See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/24419 3 | 4 | interface Element { } -------------------------------------------------------------------------------- /test/int/resources/resourceProjects.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | import * as testSetup from '../testSetup'; 3 | import { TestProjectSpec } from '../framework/frameworkTestSupport'; 4 | 5 | const DATA_ROOT = testSetup.DATA_ROOT; 6 | const REACT_PROJECT_ROOT = path.join(DATA_ROOT, 'react', 'dist'); 7 | export const reactTestSpecification = new TestProjectSpec({ projectRoot: REACT_PROJECT_ROOT }); 8 | export const reactWithLoopTestSpecification = new TestProjectSpec({ projectRoot: path.join(DATA_ROOT, 'react_with_loop', 'dist') }); 9 | -------------------------------------------------------------------------------- /test/int/testConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "reporterEnabled": "node_modules/vscode-chrome-debug-core-testsupport/out/loggingReporter.js, mocha-junit-reporter" 3 | } -------------------------------------------------------------------------------- /test/int/types/object.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | // Improve the default typing of Object.keys(o: T) to be keyof T (without the symbols) 6 | interface ObjectConstructor { 7 | keys(o: T): WithoutSymbols<(keyof T)>[]; 8 | } 9 | declare var Object: ObjectConstructor; 10 | 11 | /** Return the strings that form S and ignore the symbols */ 12 | type WithoutSymbols = S extends string ? S : string; 13 | -------------------------------------------------------------------------------- /test/int/types/server.ts: -------------------------------------------------------------------------------- 1 | import * as http from 'http'; 2 | import * as https from 'https'; 3 | 4 | export type HttpOrHttpsServer = http.Server | https.Server; 5 | -------------------------------------------------------------------------------- /test/int/utils/findPositionOfTextInFile.ts: -------------------------------------------------------------------------------- 1 | import * as _ from 'lodash'; 2 | import { createColumnNumber, createLineNumber, LineNumber } from '../core-v2/chrome/internal/locations/subtypes'; 3 | import { utils } from 'vscode-chrome-debug-core'; 4 | import { Position } from '../core-v2/chrome/internal/locations/location'; 5 | 6 | export async function findPositionOfTextInFile(filePath: string, text: string): Promise { 7 | const contentsIncludingCarriageReturns = await utils.readFileP(filePath, 'utf8'); 8 | const contents = contentsIncludingCarriageReturns.replace(/\r/g, ''); 9 | const textStartIndex = contents.indexOf(text); 10 | 11 | if (textStartIndex >= 0) { 12 | const textLineNumber = findLineNumber(contents, textStartIndex); 13 | const lastNewLineBeforeTextIndex = contents.lastIndexOf('\n', textStartIndex); 14 | const textColumNumber = createColumnNumber(textStartIndex - (lastNewLineBeforeTextIndex + 1)); 15 | return new Position(textLineNumber, textColumNumber); 16 | } else { 17 | throw new Error(`Couldn't find ${text} in ${filePath}`); 18 | } 19 | } 20 | 21 | export function findLineNumber(contents: string, characterIndex: number): LineNumber { 22 | const contentsBeforeCharacter = contents.substr(0, characterIndex); 23 | const textLineNumber = createLineNumber(_.countBy(contentsBeforeCharacter, c => c === '\n')['true'] || 0); 24 | return textLineNumber; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /test/int/utils/humanSlownessSimulator.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import { utils } from 'vscode-chrome-debug-core'; 6 | 7 | /** 8 | * The test normally run very fast, so it's difficult to see what actions they are taking in the browser. 9 | * We can use the HumanSlownessSimulator to artifically slow some classes like the puppeteer classes, so it's the actions 10 | * will be taken at a lower speed, and it'll be easier to see and understand what is happening 11 | */ 12 | export class HumanSlownessSimulator { 13 | public constructor(private readonly _slownessInMillisecondsValueGenerator: () => number = () => 500) { } 14 | 15 | public simulateSlowness(): Promise { 16 | return utils.promiseTimeout(undefined, this._slownessInMillisecondsValueGenerator()); 17 | } 18 | 19 | public wrap(object: T): T { 20 | return new HumanSpeedProxy(this, object).wrapped(); 21 | } 22 | } 23 | 24 | export class HumanSpeedProxy { 25 | constructor( 26 | private readonly _humanSlownessSimulator: HumanSlownessSimulator, 27 | private readonly _objectToWrap: T) { 28 | } 29 | 30 | public wrapped(): T { 31 | const handler = { 32 | get: (target: T, propertyKey: K, _receiver: any) => { 33 | this._humanSlownessSimulator.simulateSlowness(); 34 | const originalPropertyValue = target[propertyKey]; 35 | if (typeof originalPropertyValue === 'function') { 36 | return (...args: any) => { 37 | const result = originalPropertyValue.apply(target, args); 38 | if (result && result.then) { 39 | // Currently we only slow down async operations 40 | return result.then(async (promiseResult: object) => { 41 | await this._humanSlownessSimulator.simulateSlowness(); 42 | return typeof promiseResult === 'object' 43 | ? this._humanSlownessSimulator.wrap(promiseResult) 44 | : promiseResult; 45 | }, (rejection: unknown) => { 46 | return rejection; 47 | }); 48 | } 49 | }; 50 | } else { 51 | return originalPropertyValue; 52 | } 53 | } 54 | }; 55 | 56 | return new Proxy(this._objectToWrap, handler); 57 | } 58 | } 59 | 60 | const humanSlownessSimulator = new HumanSlownessSimulator(); 61 | 62 | const humanSlownessEnabeld = process.env.RUN_TESTS_SLOWLY === 'true'; 63 | 64 | export function slowToHumanLevel(object: T): T { 65 | return humanSlownessEnabeld 66 | ? humanSlownessSimulator.wrap(object) 67 | : object; 68 | } 69 | -------------------------------------------------------------------------------- /test/int/utils/repeat.ts: -------------------------------------------------------------------------------- 1 | export async function asyncRepeatSerially(howManyTimes: number, action: () => Promise): Promise { 2 | for (let index = 0; index < howManyTimes; ++index) { 3 | await action(); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/int/utils/waitUntilReadyWithTimeout.ts: -------------------------------------------------------------------------------- 1 | import * as _ from 'lodash'; 2 | import { utils } from 'vscode-chrome-debug-core'; 3 | 4 | // The VSTS agents run slower than our machines. Use this value to reduce proportinoally the timeouts in your dev machine 5 | export const DefaultTimeoutMultiplier = parseFloat(_.defaultTo(process.env['TEST_TIMEOUT_MULTIPLIER'], '1')); 6 | 7 | /** 8 | * Wait until the isReady condition evaluates to true. This method will evaluate it every 50 milliseconds until it returns true. It will time-out after maxWaitTimeInMilliseconds milliseconds 9 | */ 10 | export async function waitUntilReadyWithTimeout(isReady: () => boolean, maxWaitTimeInMilliseconds = DefaultTimeoutMultiplier * 30000 /* 30 seconds */) { 11 | const maximumDateTimeToWaitUntil = Date.now() + maxWaitTimeInMilliseconds; 12 | 13 | while (!isReady() && Date.now() < maximumDateTimeToWaitUntil) { 14 | await utils.promiseTimeout(undefined, 10 /*ms*/); 15 | } 16 | 17 | if (!isReady()) { 18 | throw new Error(`Timed-out after waiting for condition to be ready for ${maxWaitTimeInMilliseconds}ms. Condition: ${isReady}`); 19 | } 20 | } -------------------------------------------------------------------------------- /test/int/wizards/breakpoints/fileBreakpointsWizard.ts: -------------------------------------------------------------------------------- 1 | import { BreakpointWizard } from './breakpointWizard'; 2 | import { InternalFileBreakpointsWizard } from './implementation/internalFileBreakpointsWizard'; 3 | import { PromiseOrNot } from 'vscode-chrome-debug-core'; 4 | import { wrapWithMethodLogger } from '../../core-v2/chrome/logging/methodsCalledLogger'; 5 | import { PauseOnHitCount } from '../../core-v2/chrome/internal/breakpoints/bpActionWhenHit'; 6 | 7 | export interface IBreakpointOptions { 8 | text: string; 9 | boundText?: string; 10 | } 11 | 12 | export interface IHitCountBreakpointOptions extends IBreakpointOptions { 13 | hitCountCondition: string; 14 | } 15 | 16 | export class FileBreakpointsWizard { 17 | public constructor(private readonly _internal: InternalFileBreakpointsWizard) { } 18 | 19 | public async breakpoint(options: IBreakpointOptions): Promise { 20 | const wrappedBreakpoint = wrapWithMethodLogger(await this._internal.breakpoint({ 21 | text: options.text, 22 | boundText: options.boundText, 23 | name: `BP @ ${options.text}` 24 | })); 25 | 26 | return wrappedBreakpoint.setThenWaitForVerifiedThenValidate(); 27 | } 28 | 29 | public async hitCountBreakpoint(options: IHitCountBreakpointOptions): Promise { 30 | return (await (await this.unsetHitCountBreakpoint(options)).setThenWaitForVerifiedThenValidate()); 31 | } 32 | 33 | public async unsetHitCountBreakpoint(options: IHitCountBreakpointOptions): Promise { 34 | return wrapWithMethodLogger(await this._internal.breakpoint({ 35 | text: options.text, 36 | boundText: options.boundText, 37 | actionWhenHit: new PauseOnHitCount(options.hitCountCondition), 38 | name: `BP @ ${options.text}` 39 | })); 40 | } 41 | 42 | public batch(batchAction: (fileBreakpointsWizard: FileBreakpointsWizard) => PromiseOrNot): Promise { 43 | return this._internal.batch(batchAction); 44 | } 45 | 46 | public toString(): string { 47 | return `Breakpoints at ${this._internal.filePath}`; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /test/int/wizards/breakpoints/implementation/printedTestInputl.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | /** Remove the whitespaces from the start of each line and any comments we find at the end */ 6 | export function trimWhitespaceAndComments(printedTestInput: string): string { 7 | return printedTestInput.replace(/^\s+/gm, '').replace(/ ?\/\/.*$/gm, ''); // Remove the white space we put at the start of the lines to make the printed test input align with the code 8 | } 9 | -------------------------------------------------------------------------------- /test/int/wizards/breakpoints/implementation/stackTraceStringAssertions.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import * as assert from 'assert'; 7 | import { DebugProtocol } from 'vscode-debugprotocol'; 8 | import { expect } from 'chai'; 9 | import { findLineNumber } from '../../../utils/findPositionOfTextInFile'; 10 | import { BreakpointWizard } from '../breakpointWizard'; 11 | import { trimWhitespaceAndComments } from './printedTestInputl'; 12 | 13 | export class StackTraceStringAssertions { 14 | public constructor( 15 | private readonly _breakpoint: BreakpointWizard) { } 16 | 17 | public assertResponseMatches(stackTraceFrames: DebugProtocol.StackFrame[], expectedString: string) { 18 | 19 | stackTraceFrames.forEach(frame => { 20 | // Warning: We don't currently validate frame.source.path 21 | expect(frame.source).not.to.equal(undefined); 22 | const expectedSourceNameAndLine = ` [${frame.source!.name}] Line ${frame.line}`; 23 | expect(frame.name, 'Expected the formatted name to match the source name and line supplied as individual attributes').to.endsWith(expectedSourceNameAndLine); 24 | }); 25 | 26 | 27 | const formattedExpectedStackTrace = trimWhitespaceAndComments(expectedString); 28 | this.applyIgnores(formattedExpectedStackTrace, stackTraceFrames); 29 | const actualStackTrace = this.extractStackTrace(stackTraceFrames); 30 | assert.equal(actualStackTrace, formattedExpectedStackTrace, `Expected the stack trace when hitting ${this._breakpoint} to be:\n${formattedExpectedStackTrace}\nyet it is:\n${actualStackTrace}`); 31 | } 32 | 33 | private applyIgnores(formattedExpectedStackTrace: string, stackTrace: DebugProtocol.StackFrame[]): void { 34 | const ignoreFunctionNameText = '<__IGNORE_FUNCTION_NAME__>'; 35 | const ignoreFunctionName = findLineNumber(formattedExpectedStackTrace, formattedExpectedStackTrace.indexOf(ignoreFunctionNameText)); 36 | if (ignoreFunctionName >= 0) { 37 | expect(stackTrace.length).to.be.greaterThan(ignoreFunctionName); 38 | const ignoredFrame = stackTrace[ignoreFunctionName]; 39 | ignoredFrame.name = `${ignoreFunctionNameText} [${ignoredFrame.source!.name}] Line ${ignoredFrame.line}`; 40 | } 41 | } 42 | 43 | private extractStackTrace(stackTrace: DebugProtocol.StackFrame[]): string { 44 | return stackTrace.map(f => this.printStackTraceFrame(f)).join('\n'); 45 | } 46 | 47 | private printStackTraceFrame(frame: DebugProtocol.StackFrame): string { 48 | let frameName = frame.name; 49 | return `${frameName}:${frame.column}${frame.presentationHint && frame.presentationHint !== 'normal' ? ` (${frame.presentationHint})` : ''}`; 50 | } 51 | } -------------------------------------------------------------------------------- /test/int/wizards/variables/ManyVariablesPropertiesPrinted.ts: -------------------------------------------------------------------------------- 1 | export type ManyVariablesPropertiesPrinted = string; // `${variable.name} = ${variable.value} ${(variable.type)}\n` 2 | 3 | -------------------------------------------------------------------------------- /test/int/wizards/variables/variablesPrinting.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | export interface IVariableInformation { 7 | name: string; 8 | value: string; 9 | type?: string; 10 | } 11 | 12 | /** 13 | * Print a collection of variable informations to make it easier to compare 14 | * the expected variables of a test, and the actual variables of the debuggee 15 | */ 16 | export function printVariables(variables: IVariableInformation[]): string { 17 | const variablesPrinted = variables.map(variable => printVariable(variable)); 18 | return variablesPrinted.join('\n'); 19 | } 20 | 21 | function printVariable(variable: IVariableInformation): string { 22 | return `${variable.name} = ${variable.value} (${(variable.type)})`; 23 | } 24 | -------------------------------------------------------------------------------- /test/testUtils.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | import * as path from 'path'; 6 | import * as mockery from 'mockery'; 7 | import { execSync } from 'child_process'; 8 | import * as puppeteer from 'puppeteer'; 9 | 10 | export function setupUnhandledRejectionListener(): void { 11 | process.addListener('unhandledRejection', unhandledRejectionListener); 12 | } 13 | 14 | export function removeUnhandledRejectionListener(): void { 15 | process.removeListener('unhandledRejection', unhandledRejectionListener); 16 | } 17 | 18 | function unhandledRejectionListener(reason: any, _p: Promise) { 19 | console.log('*'); 20 | console.log('**'); 21 | console.log('***'); 22 | console.log('****'); 23 | console.log('*****'); 24 | console.log(`ERROR!! Unhandled promise rejection, a previous test may have failed but reported success.`); 25 | console.log(reason.toString()); 26 | console.log('*****'); 27 | console.log('****'); 28 | console.log('***'); 29 | console.log('**'); 30 | console.log('*'); 31 | } 32 | 33 | /** 34 | * path.resolve + fixing the drive letter to match what VS Code does. Basically tests can use this when they 35 | * want to force a path to native slashes and the correct letter case, but maybe can't use un-mocked utils. 36 | */ 37 | export function pathResolve(...segments: string[]): string { 38 | let aPath = path.resolve.apply(null, segments); 39 | 40 | if (aPath.match(/^[A-Za-z]:/)) { 41 | aPath = aPath[0].toLowerCase() + aPath.substr(1); 42 | } 43 | 44 | return aPath; 45 | } 46 | 47 | export function registerLocMocks(): void { 48 | mockery.registerMock('vscode-nls', { 49 | config: () => () => dummyLocalize, 50 | loadMessageBundle: () => dummyLocalize 51 | }); 52 | } 53 | 54 | /** 55 | * Kills all running instances of chrome (that were launched by the tests, on Windows at least) on the test host 56 | */ 57 | export function killAllChrome() { 58 | try { 59 | const killCmd = (process.platform === 'win32') ? `start powershell -WindowStyle hidden -Command "Get-Process | Where-Object {$_.Path -like '*${puppeteer.executablePath()}*'} | Stop-Process"` : 'killall chrome'; 60 | const hideWindows = process.env['TEST_DA_HIDE_WINDOWS'] === 'true'; 61 | const output = execSync(killCmd, { windowsHide: hideWindows }); // TODO: windowsHide paramenter doesn't currently work. It might be related to this: https://github.com/nodejs/node/issues/21825 62 | if (output.length > 0) { // Don't print empty lines 63 | console.log(output.toString()); 64 | } 65 | } catch (e) { 66 | console.error(`Error killing chrome: ${e.message}`); 67 | } 68 | // the kill command will exit with a non-zero code (and cause execSync to throw) if chrome is already stopped 69 | } 70 | 71 | function dummyLocalize(_id: string, englishString: string): string { 72 | return englishString; 73 | } 74 | -------------------------------------------------------------------------------- /test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "noImplicitAny": false, 5 | "removeComments": false, 6 | "target": "ES6", 7 | "sourceMap": true, 8 | "noImplicitThis": true, 9 | "outDir": "../out" 10 | }, 11 | "include": [ 12 | "../src/**/*.ts", 13 | "./**/*.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /testdata/breakOnLoad_javaScript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

testdata/breakOnLoad_javaScript

9 | 10 | -------------------------------------------------------------------------------- /testdata/breakOnLoad_javaScript/src/script.js: -------------------------------------------------------------------------------- 1 | document.write("Script.js file"); console.log("Hi"); 2 | var a = 1; 3 | var b = 1; fun(); 4 | 5 | function fun() { 6 | return true; 7 | } -------------------------------------------------------------------------------- /testdata/breakOnLoad_javaScript/src/script2.js: -------------------------------------------------------------------------------- 1 | document.write("Script2.js file"); console.log("Hi2"); 2 | var a = 1; 3 | var b = 1; fun2(); 4 | 5 | function fun2() { 6 | return true; 7 | } -------------------------------------------------------------------------------- /testdata/breakOnLoad_sourceMaps/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

testdata/breakOnLoad_sourceMaps

8 | 9 | -------------------------------------------------------------------------------- /testdata/breakOnLoad_sourceMaps/out/SubDir/script.js: -------------------------------------------------------------------------------- 1 | //# sourceMappingURL=script.js.map -------------------------------------------------------------------------------- /testdata/breakOnLoad_sourceMaps/out/SubDir/script.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"script.js","sourceRoot":"","sources":["../../src/SubDir/script.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /testdata/breakOnLoad_sourceMaps/out/script.bin.js: -------------------------------------------------------------------------------- 1 | //# sourceMappingURL=script.bin.js.map -------------------------------------------------------------------------------- /testdata/breakOnLoad_sourceMaps/out/script.bin.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"script.bin.js","sourceRoot":"","sources":["../src/script.bin.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /testdata/breakOnLoad_sourceMaps/out/script.js: -------------------------------------------------------------------------------- 1 | document.write("Script.ts file"); 2 | console.log("Hi"); 3 | var a = 1; 4 | var b = 1; 5 | fun(); 6 | function fun() { 7 | return true; 8 | } 9 | //# sourceMappingURL=script.js.map -------------------------------------------------------------------------------- /testdata/breakOnLoad_sourceMaps/out/script.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"script.js","sourceRoot":"","sources":["../src/script.ts"],"names":[],"mappings":"AAAA,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpD,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,IAAI,CAAC,GAAG,CAAC,CAAC;AAAC,GAAG,EAAE,CAAC;AAEjB;IACI,MAAM,CAAC,IAAI,CAAC;AAChB,CAAC"} -------------------------------------------------------------------------------- /testdata/breakOnLoad_sourceMaps/out/script1.js: -------------------------------------------------------------------------------- 1 | //# sourceMappingURL=script1.js.map -------------------------------------------------------------------------------- /testdata/breakOnLoad_sourceMaps/out/script1.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"script1.js","sourceRoot":"","sources":["../src/script1.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /testdata/breakOnLoad_sourceMaps/src/script.ts: -------------------------------------------------------------------------------- 1 | document.write("Script.ts file"); console.log("Hi"); 2 | var a = 1; 3 | var b = 1; fun(); 4 | 5 | function fun(): boolean { 6 | return true; 7 | } -------------------------------------------------------------------------------- /testdata/breakOnLoad_sourceMaps/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "out", 4 | "sourceMap": true 5 | } 6 | } -------------------------------------------------------------------------------- /testdata/breakOnLoad_webpack/dist/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 0); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ([ 67 | /* 0 */ 68 | /***/ (function(module, exports) { 69 | 70 | document.write("Script.js file"); 71 | console.log("Hi"); 72 | var a = 1; 73 | var b = 1; 74 | fun(); 75 | 76 | function fun() { 77 | return true; 78 | } 79 | 80 | /***/ }) 81 | /******/ ]); 82 | //# sourceMappingURL=bundle.js.map -------------------------------------------------------------------------------- /testdata/breakOnLoad_webpack/dist/bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///webpack/bootstrap 110f404fad45858d5cd9","webpack:///./src/script.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AC7DA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,C","file":"bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 110f404fad45858d5cd9","document.write(\"Script.js file\");\r\nconsole.log(\"Hi\");\r\nvar a = 1;\r\nvar b = 1;\r\nfun();\r\n\r\nfunction fun() {\r\n return true;\r\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/script.js\n// module id = 0\n// module chunks = 0"],"sourceRoot":""} -------------------------------------------------------------------------------- /testdata/breakOnLoad_webpack/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

testdata/breakOnLoad_webpack

8 | 9 | -------------------------------------------------------------------------------- /testdata/breakOnLoad_webpack/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack" 4 | }, 5 | "devDependencies": { 6 | "webpack": "^3.8.1" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /testdata/breakOnLoad_webpack/src/script.js: -------------------------------------------------------------------------------- 1 | document.write("Script.js file"); 2 | console.log("Hi"); 3 | var a = 1; 4 | var b = 1; 5 | fun(); 6 | 7 | function fun() { 8 | return true; 9 | } -------------------------------------------------------------------------------- /testdata/breakOnLoad_webpack/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | entry: './src/script.js', 5 | devtool: 'source-map', 6 | output: { 7 | filename: 'bundle.js', 8 | path: path.resolve(__dirname, 'dist') 9 | } 10 | }; -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for node debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "debugServer": 4712, 9 | "name": "Launch Program", 10 | "type": "chrome", 11 | "request": "launch", 12 | "url": "http://localhost:7890", 13 | "webRoot": "${workspaceFolder}", 14 | "skipFiles": [ 15 | "b.js" 16 | ], 17 | "sourceMaps": true 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "0.1.0", 5 | "command": "npm", 6 | "isShellCommand": true, 7 | "showOutput": "always", 8 | "suppressTaskName": true, 9 | "tasks": [ 10 | { 11 | "taskName": "build", 12 | "args": ["run", "build"] 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/gulpfile.js: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------- 2 | * Copyright (C) Microsoft Corporation. All rights reserved. 3 | *--------------------------------------------------------*/ 4 | 5 | const gulp = require('gulp'); 6 | const ts = require('gulp-typescript'); 7 | const typescript = require('typescript'); 8 | const sourcemaps = require('gulp-sourcemaps'); 9 | const concat = require('gulp-concat'); 10 | const filter = require('gulp-filter'); 11 | 12 | const tsProject = ts.createProject('tsconfig.json', { typescript }); 13 | gulp.task('build', function () { 14 | const sourceBFilter = filter(['**/sourceB*'], { restore: true }); 15 | 16 | return tsProject.src() 17 | .pipe(sourcemaps.init()) 18 | .pipe(tsProject()).js 19 | .pipe(sourceBFilter) 20 | .pipe(concat('b.js')) 21 | .pipe(sourceBFilter.restore) 22 | .pipe(sourcemaps.write('.', { includeContent: false })) 23 | .pipe(gulp.dest('./out')); 24 | }); 25 | -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

testdata/calls-between-merged-files

9 | 10 | -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/out/b.js: -------------------------------------------------------------------------------- 1 | function callbackCaller1(cb) { 2 | callbackCaller2(cb); 3 | } 4 | 5 | function callbackCaller2(cb) { 6 | cb(); 7 | } 8 | 9 | //# sourceMappingURL=b.js.map 10 | -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/out/b.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../sourceB1.ts","../sourceB2.ts"],"names":[],"mappings":"AAAA,yBAAyB,EAAY;IACjC,eAAe,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;;ACFD,yBAAyB,EAAY;IACjC,EAAE,EAAE,CAAC;AACT,CAAC","file":"b.js"} -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/out/sourceA.js: -------------------------------------------------------------------------------- 1 | function f() { 2 | console.log('mapped'); 3 | } 4 | setInterval(function () { 5 | callbackCaller1(f); 6 | }, 1000); 7 | 8 | //# sourceMappingURL=sourceA.js.map 9 | -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/out/sourceA.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../sourceA.ts"],"names":[],"mappings":"AAAA;IACI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,WAAW,CAAC;IACR,eAAe,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC,EAAE,IAAI,CAAC,CAAC","file":"sourceA.js"} -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testdata-calls-between-merged-files", 3 | "version": "1.0.0", 4 | "description": "Test project for vscode-node-debug2 using gulp", 5 | "author": "", 6 | "license": "MIT", 7 | "scripts": { 8 | "build": "gulp build", 9 | "serve": "http-server -p 7890 ." 10 | }, 11 | "dependencies": {}, 12 | "devDependencies": { 13 | "@types/node": "^6.0.41", 14 | "gulp": "^3.9.1", 15 | "gulp-concat": "^2.6.1", 16 | "gulp-filter": "^4.0.0", 17 | "gulp-sourcemaps": "^1.9.1", 18 | "gulp-typescript": "^3.1.4", 19 | "http-server": "^0.9.0", 20 | "typescript": "^2.1.4" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/sourceA.ts: -------------------------------------------------------------------------------- 1 | function f() { 2 | console.log('mapped'); 3 | } 4 | 5 | setInterval(() => { 6 | callbackCaller1(f); 7 | }, 1000); -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/sourceB1.ts: -------------------------------------------------------------------------------- 1 | function callbackCaller1(cb: Function): void { 2 | callbackCaller2(cb); 3 | } 4 | -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/sourceB2.ts: -------------------------------------------------------------------------------- 1 | function callbackCaller2(cb: Function): void { 2 | cb(); 3 | } 4 | -------------------------------------------------------------------------------- /testdata/calls-between-merged-files/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "out", 4 | "target": "es5", 5 | "sourceMap": true 6 | } 7 | } -------------------------------------------------------------------------------- /testdata/calls-between-sourcemapped-files/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

testdata/calls-between-sourcemapped-files

9 | 10 | -------------------------------------------------------------------------------- /testdata/calls-between-sourcemapped-files/out/sourceA.js: -------------------------------------------------------------------------------- 1 | function f() { 2 | console.log('mapped'); 3 | } 4 | setInterval(function () { 5 | callbackCaller(f); 6 | }, 0); 7 | //# sourceMappingURL=sourceA.js.map -------------------------------------------------------------------------------- /testdata/calls-between-sourcemapped-files/out/sourceA.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"sourceA.js","sourceRoot":"","sources":["../src/sourceA.ts"],"names":[],"mappings":"AAAA;IACI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,WAAW,CAAC;IACR,cAAc,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC,EAAE,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /testdata/calls-between-sourcemapped-files/out/sourceB.js: -------------------------------------------------------------------------------- 1 | function callbackCaller(cb) { 2 | cb(); 3 | } 4 | //# sourceMappingURL=sourceB.js.map -------------------------------------------------------------------------------- /testdata/calls-between-sourcemapped-files/out/sourceB.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"sourceB.js","sourceRoot":"","sources":["../src/sourceB.ts"],"names":[],"mappings":"AAAA,wBAAwB,EAAY;IAChC,EAAE,EAAE,CAAC;AACT,CAAC"} -------------------------------------------------------------------------------- /testdata/calls-between-sourcemapped-files/src/sourceA.ts: -------------------------------------------------------------------------------- 1 | function f() { 2 | console.log('mapped'); 3 | } 4 | 5 | setInterval(() => { 6 | callbackCaller(f); 7 | }, 0); -------------------------------------------------------------------------------- /testdata/calls-between-sourcemapped-files/src/sourceB.ts: -------------------------------------------------------------------------------- 1 | function callbackCaller(cb: Function): void { 2 | cb(); 3 | } 4 | -------------------------------------------------------------------------------- /testdata/calls-between-sourcemapped-files/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "out", 4 | "sourceMap": true 5 | } 6 | } -------------------------------------------------------------------------------- /testdata/columns/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

testdata/columns

8 | 9 | -------------------------------------------------------------------------------- /testdata/columns/out/script.js: -------------------------------------------------------------------------------- 1 | setInterval(function () { 2 | var x = 1; 3 | for (var i = 0; i < 5; i++) { 4 | x++; 5 | x++; 6 | x++; 7 | } 8 | }, 0); 9 | //# sourceMappingURL=script.js.map -------------------------------------------------------------------------------- /testdata/columns/out/script.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"script.js","sourceRoot":"","sources":["../src/script.ts"],"names":[],"mappings":"AAAA,WAAW,CAAC;IACR,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACzB,CAAC,EAAE,CAAC;QAAG,CAAC,EAAE,CAAC;QAAI,CAAC,EAAE,CAAC;IACvB,CAAC;AACL,CAAC,EAAE,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /testdata/columns/src/script.ts: -------------------------------------------------------------------------------- 1 | setInterval(() => { 2 | let x = 1; 3 | for (let i = 0; i < 5; i++) { 4 | x++; x++; x++; 5 | } 6 | }, 0); -------------------------------------------------------------------------------- /testdata/columns/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "out", 4 | "sourceMap": true 5 | } 6 | } -------------------------------------------------------------------------------- /testdata/inline_scripts/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "type": "chrome", 5 | "request": "launch", 6 | "name": "Launch Chrome", 7 | "trace": "verbose", 8 | //"url": "http://localhost:5000/other.html", 9 | "file": "C:/development/debug_adapters_v2/vscode-chrome-debug/testdata/inline_scripts/other.html", 10 | "webRoot": "${workspaceFolder}" 11 | }, 12 | { 13 | "type": "my-chrome", 14 | "request": "launch", 15 | "name": "My Launch Chrome", 16 | "url": "http://localhost:5000/other.html", 17 | "webRoot": "${workspaceFolder}" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /testdata/inline_scripts/multiple.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

Hello, world!

10 | 11 | 12 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 42 | 43 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /testdata/inline_scripts/single.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

Hello, world!

10 | 11 | 12 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /testdata/intervalDebugger/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

testdata/intervalDebugger

8 | 9 | -------------------------------------------------------------------------------- /testdata/intervalDebugger/out/app.js: -------------------------------------------------------------------------------- 1 | function debuggerStatement() { 2 | debugger; 3 | } 4 | setInterval(debuggerStatement, 100); 5 | //# sourceMappingURL=app.js.map -------------------------------------------------------------------------------- /testdata/intervalDebugger/out/app.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA;IACI,QAAQ,CAAC;AACb,CAAC;AAED,WAAW,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC"} -------------------------------------------------------------------------------- /testdata/intervalDebugger/src/app.ts: -------------------------------------------------------------------------------- 1 | function debuggerStatement() { 2 | debugger; 3 | } 4 | 5 | setInterval(debuggerStatement, 100); -------------------------------------------------------------------------------- /testdata/intervalDebugger/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": true, 4 | "outDir": "out" 5 | } 6 | } -------------------------------------------------------------------------------- /testdata/labelTest.ts: -------------------------------------------------------------------------------- 1 | 2 | export function blubyyb() { 3 | 4 | console.log('hello'); 5 | console.log('hello'); 6 | console.log('hello'); 7 | console.log('hello'); 8 | console.log('hello'); 9 | console.log('world'); // bpLabel: WorldLabel 10 | console.log('hello'); /* bpLabel: blockLabel */ 11 | console.log('hello'); 12 | console.log('hello'); 13 | 14 | } -------------------------------------------------------------------------------- /testdata/react/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /testdata/react/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "Launch Chrome against localhost", 11 | "url": "http://localhost:5000", 12 | "webRoot": "${workspaceFolder}/dist" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /testdata/react/README.md: -------------------------------------------------------------------------------- 1 | Test project for the React framework, created using [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | Can re-generate the project output with 4 | ### `npm run build` 5 | -------------------------------------------------------------------------------- /testdata/react/config/jest/cssTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // This is a custom Jest transformer turning style imports into empty objects. 4 | // http://facebook.github.io/jest/docs/en/webpack.html 5 | 6 | module.exports = { 7 | process() { 8 | return 'module.exports = {};'; 9 | }, 10 | getCacheKey() { 11 | // The output is always the same. 12 | return 'cssTransform'; 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /testdata/react/config/jest/fileTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | 5 | // This is a custom Jest transformer turning file imports into filenames. 6 | // http://facebook.github.io/jest/docs/en/webpack.html 7 | 8 | module.exports = { 9 | process(src, filename) { 10 | const assetFilename = JSON.stringify(path.basename(filename)); 11 | 12 | if (filename.match(/\.svg$/)) { 13 | return `const React = require('react'); 14 | module.exports = { 15 | __esModule: true, 16 | default: ${assetFilename}, 17 | ReactComponent: React.forwardRef((props, ref) => ({ 18 | $$typeof: Symbol.for('react.element'), 19 | type: 'svg', 20 | ref: ref, 21 | key: null, 22 | props: Object.assign({}, props, { 23 | children: ${assetFilename} 24 | }) 25 | })), 26 | };`; 27 | } 28 | 29 | return `module.exports = ${assetFilename};`; 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /testdata/react/config/paths.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const url = require('url'); 6 | 7 | // Make sure any symlinks in the project folder are resolved: 8 | // https://github.com/facebook/create-react-app/issues/637 9 | const appDirectory = fs.realpathSync(process.cwd()); 10 | const resolveApp = relativePath => path.resolve(appDirectory, relativePath); 11 | 12 | const envPublicUrl = process.env.PUBLIC_URL; 13 | 14 | function ensureSlash(inputPath, needsSlash) { 15 | const hasSlash = inputPath.endsWith('/'); 16 | if (hasSlash && !needsSlash) { 17 | return inputPath.substr(0, inputPath.length - 1); 18 | } else if (!hasSlash && needsSlash) { 19 | return `${inputPath}/`; 20 | } else { 21 | return inputPath; 22 | } 23 | } 24 | 25 | const getPublicUrl = appPackageJson => 26 | envPublicUrl || require(appPackageJson).homepage; 27 | 28 | // We use `PUBLIC_URL` environment variable or "homepage" field to infer 29 | // "public path" at which the app is served. 30 | // Webpack needs to know it to put the right 37 | 38 | -------------------------------------------------------------------------------- /testdata/react/dist/out/main.chunk.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/App.js","webpack:///./src/Counter.jsx","webpack:///./src/Running.js","webpack:///./src/index.js"],"names":["App","Component","runForever","Counter","props","state","count","console","log","newval","setState","stepIn","increment","num","setTimeout","ReactDOM","render","document","getElementById"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;;IAEMA,G;;;;;;;;;;;;;6BACK;AACP,aAAS;AACP,mEAAC,gDAAD;AADF;AAGD;;;;EALeC,+C;;AAQlBC,2DAAU;AAEKF,kEAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;ACbA;AAEO,IAAMG,OAAb;AAAA;AAAA;AAAA;;AAEE,mBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACjB,mYAAMA,KAAN;AAEA,UAAKC,KAAL,GAAa;AACXC,WAAK,EAAE;AADI,KAAb;AAHiB;AAMlB;;AARH;AAAA;AAAA,gCAUgB;AACVC,aAAO,CAACC,GAAR,CAAY,MAAZ,EADU,CACW;;AACrB,UAAMC,MAAM,GAAG,KAAKJ,KAAL,CAAWC,KAAX,GAAmB,CAAlC;AACA,WAAKI,QAAL,CAAc;AAAEJ,aAAK,EAAEG;AAAT,OAAd;AACA,WAAKE,MAAL,GAJU,CAIK;AAChB;AAfL;AAAA;AAAA,6BAiBa;AACPJ,aAAO,CAACC,GAAR,CAAY,YAAZ,EADO,CACoB;AAC5B;AAnBL;AAAA;AAAA,6BAqBa;AAAA;;AACP,aACE;AAAK,iBAAS,EAAC;AAAf,2BACiB,KAAKH,KAAL,CAAWC,KAD5B,OAEE,wEACE;AAAQ,UAAE,EAAC,cAAX;AAA0B,eAAO,EAAG;AAAA,iBAAM,MAAI,CAACM,SAAL,EAAN;AAAA;AAApC,qBADF,MAFF,CADF;AAQD;AA9BL;;AAAA;AAAA,EAA6BX,+CAA7B,E;;;;;;;;;;;;ACFA;AAAA;AAAA;AAEA,IAAIY,GAAG,GAAG,CAAV;AACO,SAASX,UAAT,GAAsB;AACzBY,YAAU,CAAC,YAAM;AACbD,OAAG;AACHX,cAAU;AACb,GAHS,EAGP,EAHO,CAAV;AAIH,C;;;;;;;;;;;;ACTD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEAa,gDAAQ,CAACC,MAAT,CAAgB,2DAAC,4CAAD,OAAhB,EAAyBC,QAAQ,CAACC,cAAT,CAAwB,MAAxB,CAAzB,E","file":"out/main.chunk.js","sourcesContent":["import React, { Component } from 'react';\r\nimport { Counter } from './Counter';\r\nimport { runForever } from './Running';\r\n\r\nclass App extends Component {\r\n render() {\r\n return ( // bpLabel: react_App_render\r\n \r\n );\r\n }\r\n}\r\n\r\nrunForever();\r\n\r\nexport default App;\r\n","\r\nimport React, { Component } from 'react';\r\n\r\nexport class Counter extends Component {\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n count: 0\r\n };\r\n }\r\n\r\n increment() {\r\n console.log('blub'); // bpLabel: react_Counter_increment\r\n const newval = this.state.count + 1 ;\r\n this.setState({ count: newval });\r\n this.stepIn(); //bpLabel: react_Counter_stepInStop\r\n }\r\n\r\n stepIn() {\r\n console.log('stepped in'); //bpLabel: react_Counter_stepIn;\r\n }\r\n\r\n render() {\r\n return (\r\n
\r\n Click count = {this.state.count};\r\n
\r\n { /* bpLabel: react_Counter_stepOut */ }\r\n
\r\n
\r\n );\r\n }\r\n }\r\n\r\n","\r\n// a script to keep running forever\r\n\r\nlet num = 0;\r\nexport function runForever() {\r\n setTimeout(() => {\r\n num++;\r\n runForever();\r\n }, 50);\r\n}","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport App from './App';\r\n\r\nReactDOM.render(, document.getElementById('root'));\r\n"],"sourceRoot":""} -------------------------------------------------------------------------------- /testdata/react/dist/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Counter } from './Counter'; 3 | import { runForever } from './Running'; 4 | 5 | class App extends Component { 6 | render() { 7 | return ( // bpLabel: react_App_render 8 | 9 | ); 10 | } 11 | } 12 | 13 | runForever(); 14 | 15 | export default App; 16 | -------------------------------------------------------------------------------- /testdata/react/dist/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /testdata/react/dist/src/Counter.jsx: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component } from 'react'; 3 | 4 | export class Counter extends Component { 5 | 6 | constructor(props) { 7 | super(props); 8 | 9 | this.state = { 10 | count: 0 11 | }; 12 | } 13 | 14 | increment() { 15 | console.log('blub'); // bpLabel: react_Counter_increment 16 | const newval = this.state.count + 1 ; 17 | this.setState({ count: newval }); 18 | this.stepIn(); //bpLabel: react_Counter_stepInStop 19 | } 20 | 21 | stepIn() { 22 | console.log('stepped in'); //bpLabel: react_Counter_stepIn; 23 | } 24 | 25 | render() { 26 | return ( 27 |
28 | Click count = {this.state.count}; 29 |
30 | { /* bpLabel: react_Counter_stepOut */ } 31 |
32 |
33 | ); 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /testdata/react/dist/src/Running.js: -------------------------------------------------------------------------------- 1 | 2 | // a script to keep running forever 3 | 4 | let num = 0; 5 | export function runForever() { 6 | setTimeout(() => { 7 | num++; 8 | runForever(); 9 | }, 50); 10 | } -------------------------------------------------------------------------------- /testdata/react/dist/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | ReactDOM.render(, document.getElementById('root')); 6 | -------------------------------------------------------------------------------- /testdata/react/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/vscode-chrome-debug/96f4e5001883bba776c58df86c39840a21a0c2ff/testdata/react/public/favicon.ico -------------------------------------------------------------------------------- /testdata/react/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | 21 | React App 22 | 23 | 24 | 25 |
26 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /testdata/react/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /testdata/react/scripts/test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Do this as the first thing so that any code reading it knows the right env. 4 | process.env.BABEL_ENV = 'test'; 5 | process.env.NODE_ENV = 'test'; 6 | process.env.PUBLIC_URL = ''; 7 | 8 | // Makes the script crash on unhandled rejections instead of silently 9 | // ignoring them. In the future, promise rejections that are not handled will 10 | // terminate the Node.js process with a non-zero exit code. 11 | process.on('unhandledRejection', err => { 12 | throw err; 13 | }); 14 | 15 | // Ensure environment variables are read. 16 | require('../config/env'); 17 | 18 | 19 | const jest = require('jest'); 20 | const execSync = require('child_process').execSync; 21 | let argv = process.argv.slice(2); 22 | 23 | function isInGitRepository() { 24 | try { 25 | execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' }); 26 | return true; 27 | } catch (e) { 28 | return false; 29 | } 30 | } 31 | 32 | function isInMercurialRepository() { 33 | try { 34 | execSync('hg --cwd . root', { stdio: 'ignore' }); 35 | return true; 36 | } catch (e) { 37 | return false; 38 | } 39 | } 40 | 41 | // Watch unless on CI, in coverage mode, explicitly adding `--no-watch`, 42 | // or explicitly running all tests 43 | if ( 44 | !process.env.CI && 45 | argv.indexOf('--coverage') === -1 && 46 | argv.indexOf('--no-watch') === -1 && 47 | argv.indexOf('--watchAll') === -1 48 | ) { 49 | // https://github.com/facebook/create-react-app/issues/5210 50 | const hasSourceControl = isInGitRepository() || isInMercurialRepository(); 51 | argv.push(hasSourceControl ? '--watch' : '--watchAll'); 52 | } 53 | 54 | // Jest doesn't have this option so we'll remove it 55 | if (argv.indexOf('--no-watch') !== -1) { 56 | argv = argv.filter(arg => arg !== '--no-watch'); 57 | } 58 | 59 | 60 | jest.run(argv); 61 | -------------------------------------------------------------------------------- /testdata/react/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Counter } from './Counter'; 3 | import { runForever } from './Running'; 4 | 5 | class App extends Component { 6 | render() { 7 | return ( // bpLabel: react_App_render 8 | 9 | ); 10 | } 11 | } 12 | 13 | runForever(); 14 | 15 | export default App; 16 | -------------------------------------------------------------------------------- /testdata/react/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /testdata/react/src/Counter.jsx: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component } from 'react'; 3 | 4 | export class Counter extends Component { 5 | 6 | constructor(props) { 7 | super(props); 8 | 9 | this.state = { 10 | count: 0 11 | }; 12 | } 13 | 14 | increment() { 15 | console.log('blub'); // bpLabel: react_Counter_increment 16 | const newval = this.state.count + 1 ; 17 | this.setState({ count: newval }); 18 | this.stepIn(); //bpLabel: react_Counter_stepInStop 19 | } 20 | 21 | stepIn() { 22 | console.log('stepped in'); //bpLabel: react_Counter_stepIn; 23 | } 24 | 25 | render() { 26 | return ( 27 |
28 | Click count = {this.state.count}; 29 |
30 | { /* bpLabel: react_Counter_stepOut */ } 31 |
32 |
33 | ); 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /testdata/react/src/Running.js: -------------------------------------------------------------------------------- 1 | 2 | // a script to keep running forever 3 | 4 | let num = 0; 5 | export function runForever() { 6 | setTimeout(() => { 7 | num++; 8 | runForever(); 9 | }, 50); 10 | } -------------------------------------------------------------------------------- /testdata/react/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | ReactDOM.render(, document.getElementById('root')); 6 | -------------------------------------------------------------------------------- /testdata/react_with_loop/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /testdata/react_with_loop/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "Launch Chrome against localhost", 11 | "url": "http://localhost:5000", 12 | "webRoot": "${workspaceFolder}/dist" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /testdata/react_with_loop/README.md: -------------------------------------------------------------------------------- 1 | Test project for the React framework, created using [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | Can re-generate the project output with 4 | ### `npm run build` 5 | -------------------------------------------------------------------------------- /testdata/react_with_loop/config/jest/cssTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // This is a custom Jest transformer turning style imports into empty objects. 4 | // http://facebook.github.io/jest/docs/en/webpack.html 5 | 6 | module.exports = { 7 | process() { 8 | return 'module.exports = {};'; 9 | }, 10 | getCacheKey() { 11 | // The output is always the same. 12 | return 'cssTransform'; 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /testdata/react_with_loop/config/jest/fileTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | 5 | // This is a custom Jest transformer turning file imports into filenames. 6 | // http://facebook.github.io/jest/docs/en/webpack.html 7 | 8 | module.exports = { 9 | process(src, filename) { 10 | const assetFilename = JSON.stringify(path.basename(filename)); 11 | 12 | if (filename.match(/\.svg$/)) { 13 | return `const React = require('react'); 14 | module.exports = { 15 | __esModule: true, 16 | default: ${assetFilename}, 17 | ReactComponent: React.forwardRef((props, ref) => ({ 18 | $$typeof: Symbol.for('react.element'), 19 | type: 'svg', 20 | ref: ref, 21 | key: null, 22 | props: Object.assign({}, props, { 23 | children: ${assetFilename} 24 | }) 25 | })), 26 | };`; 27 | } 28 | 29 | return `module.exports = ${assetFilename};`; 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /testdata/react_with_loop/config/paths.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const url = require('url'); 6 | 7 | // Make sure any symlinks in the project folder are resolved: 8 | // https://github.com/facebook/create-react-app/issues/637 9 | const appDirectory = fs.realpathSync(process.cwd()); 10 | const resolveApp = relativePath => path.resolve(appDirectory, relativePath); 11 | 12 | const envPublicUrl = process.env.PUBLIC_URL; 13 | 14 | function ensureSlash(inputPath, needsSlash) { 15 | const hasSlash = inputPath.endsWith('/'); 16 | if (hasSlash && !needsSlash) { 17 | return inputPath.substr(0, inputPath.length - 1); 18 | } else if (!hasSlash && needsSlash) { 19 | return `${inputPath}/`; 20 | } else { 21 | return inputPath; 22 | } 23 | } 24 | 25 | const getPublicUrl = appPackageJson => 26 | envPublicUrl || require(appPackageJson).homepage; 27 | 28 | // We use `PUBLIC_URL` environment variable or "homepage" field to infer 29 | // "public path" at which the app is served. 30 | // Webpack needs to know it to put the right 37 | 38 | -------------------------------------------------------------------------------- /testdata/react_with_loop/dist/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Counter } from './Counter'; 3 | import { runForever } from './Running'; 4 | 5 | class App extends Component { 6 | render() { 7 | return ( 8 | 9 | ); 10 | } 11 | } 12 | 13 | runForever(); 14 | 15 | export default App; 16 | -------------------------------------------------------------------------------- /testdata/react_with_loop/dist/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /testdata/react_with_loop/dist/src/Counter.jsx: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component } from 'react'; 3 | 4 | export class Counter extends Component { 5 | 6 | constructor(props) { 7 | super(props); 8 | 9 | this.state = { 10 | count: 0 11 | }; 12 | } 13 | 14 | increment() { 15 | const newval = this.state.count + 1 ; 16 | this.setState({ count: newval }); 17 | this.loop(); 18 | } 19 | 20 | render() { 21 | return ( 22 |
23 | Click count = {this.state.count}; 24 |
25 | { } 26 |
27 |
28 | ); 29 | } 30 | 31 | loop() { 32 | for (let iterationNumber = 1; iterationNumber < 200; ++iterationNumber) { 33 | console.log(`starting iteration: ${iterationNumber}`); 34 | const squared = iterationNumber * iterationNumber; 35 | console.log(`ending iteration: ${iterationNumber} squared: ${squared}`); 36 | } 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /testdata/react_with_loop/dist/src/Running.js: -------------------------------------------------------------------------------- 1 | 2 | // a script to keep running forever 3 | 4 | let num = 0; 5 | export function runForever() { 6 | setTimeout(() => { 7 | num++; 8 | runForever(); 9 | }, 50); 10 | } -------------------------------------------------------------------------------- /testdata/react_with_loop/dist/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | ReactDOM.render(, document.getElementById('root')); 6 | -------------------------------------------------------------------------------- /testdata/react_with_loop/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/vscode-chrome-debug/96f4e5001883bba776c58df86c39840a21a0c2ff/testdata/react_with_loop/public/favicon.ico -------------------------------------------------------------------------------- /testdata/react_with_loop/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | 21 | React App 22 | 23 | 24 | 25 |
26 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /testdata/react_with_loop/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /testdata/react_with_loop/scripts/test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Do this as the first thing so that any code reading it knows the right env. 4 | process.env.BABEL_ENV = 'test'; 5 | process.env.NODE_ENV = 'test'; 6 | process.env.PUBLIC_URL = ''; 7 | 8 | // Makes the script crash on unhandled rejections instead of silently 9 | // ignoring them. In the future, promise rejections that are not handled will 10 | // terminate the Node.js process with a non-zero exit code. 11 | process.on('unhandledRejection', err => { 12 | throw err; 13 | }); 14 | 15 | // Ensure environment variables are read. 16 | require('../config/env'); 17 | 18 | 19 | const jest = require('jest'); 20 | const execSync = require('child_process').execSync; 21 | let argv = process.argv.slice(2); 22 | 23 | function isInGitRepository() { 24 | try { 25 | execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' }); 26 | return true; 27 | } catch (e) { 28 | return false; 29 | } 30 | } 31 | 32 | function isInMercurialRepository() { 33 | try { 34 | execSync('hg --cwd . root', { stdio: 'ignore' }); 35 | return true; 36 | } catch (e) { 37 | return false; 38 | } 39 | } 40 | 41 | // Watch unless on CI, in coverage mode, explicitly adding `--no-watch`, 42 | // or explicitly running all tests 43 | if ( 44 | !process.env.CI && 45 | argv.indexOf('--coverage') === -1 && 46 | argv.indexOf('--no-watch') === -1 && 47 | argv.indexOf('--watchAll') === -1 48 | ) { 49 | // https://github.com/facebook/create-react-app/issues/5210 50 | const hasSourceControl = isInGitRepository() || isInMercurialRepository(); 51 | argv.push(hasSourceControl ? '--watch' : '--watchAll'); 52 | } 53 | 54 | // Jest doesn't have this option so we'll remove it 55 | if (argv.indexOf('--no-watch') !== -1) { 56 | argv = argv.filter(arg => arg !== '--no-watch'); 57 | } 58 | 59 | 60 | jest.run(argv); 61 | -------------------------------------------------------------------------------- /testdata/react_with_loop/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Counter } from './Counter'; 3 | import { runForever } from './Running'; 4 | 5 | class App extends Component { 6 | render() { 7 | return ( 8 | 9 | ); 10 | } 11 | } 12 | 13 | runForever(); 14 | 15 | export default App; 16 | -------------------------------------------------------------------------------- /testdata/react_with_loop/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /testdata/react_with_loop/src/Counter.jsx: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component } from 'react'; 3 | 4 | export class Counter extends Component { 5 | 6 | constructor(props) { 7 | super(props); 8 | 9 | this.state = { 10 | count: 0 11 | }; 12 | } 13 | 14 | increment() { 15 | const newval = this.state.count + 1 ; 16 | this.setState({ count: newval }); 17 | this.loop(); 18 | } 19 | 20 | render() { 21 | return ( 22 |
23 | Click count = {this.state.count}; 24 |
25 | { } 26 |
27 |
28 | ); 29 | } 30 | 31 | loop() { 32 | for (let iterationNumber = 1; iterationNumber < 200; ++iterationNumber) { 33 | console.log(`starting iteration: ${iterationNumber}`); 34 | const squared = iterationNumber * iterationNumber; 35 | console.log(`ending iteration: ${iterationNumber} squared: ${squared}`); 36 | } 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /testdata/react_with_loop/src/Running.js: -------------------------------------------------------------------------------- 1 | 2 | // a script to keep running forever 3 | 4 | let num = 0; 5 | export function runForever() { 6 | setTimeout(() => { 7 | num++; 8 | runForever(); 9 | }, 50); 10 | } -------------------------------------------------------------------------------- /testdata/react_with_loop/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | ReactDOM.render(, document.getElementById('root')); 6 | -------------------------------------------------------------------------------- /testdata/simple/app.js: -------------------------------------------------------------------------------- 1 | function log() { 2 | console.log('Very simple webpage'); 3 | } 4 | 5 | log(); -------------------------------------------------------------------------------- /testdata/simple/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Hello, world!

8 | 9 | -------------------------------------------------------------------------------- /testdata/stackTrace/app.js: -------------------------------------------------------------------------------- 1 | function buttonClick() { 2 | setTimeout(timeoutCallback, 100); 3 | } 4 | 5 | function timeoutCallback() { 6 | eval("evalCallback();"); 7 | } 8 | 9 | function evalCallback() { 10 | (function() { 11 | console.log('Test stack trace here'); 12 | })(); 13 | } -------------------------------------------------------------------------------- /testdata/stackTrace/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /testdata/variablesScopes/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "Launch Chrome against localhost", 11 | "url": "http://localhost:8080", 12 | "webRoot": "${workspaceFolder}", 13 | // "debugServer": 4712 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /testdata/variablesScopes/blockScope/blockVariablesApp.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | console.log('TestCode: START'); 3 | let i; 4 | for (i = 7; i < 10; ++i) { 5 | console.log('TestCode: BEFORE-ADDING-VARIABLES'); 6 | 7 | // Try to create a variable of each important type, to verify that we can see their contents properly 8 | 9 | const globalCode = 'page loaded'; 10 | 11 | function consoleDotLog(m) { 12 | console.log(m) 13 | } 14 | 15 | const manyPropsObj = { prop2: 'abc', prop1: 'def' }; 16 | for (let i = 0; i <= 100; i++) manyPropsObj[i] = 2 * i + 1; 17 | 18 | let r = /^asdf.*$/g; 19 | let longStr = `this is a 20 | string with 21 | newlines`; 22 | let element = document.body; 23 | const buffer = new ArrayBuffer(8); 24 | let buffView = new Int32Array(buffer); 25 | buffView[0] = 234; 26 | let s = Symbol('hi'); 27 | let e = new Error('hi'); 28 | 29 | let m = new Map(); 30 | m.set('a', 1); 31 | 32 | let b = document.body; 33 | const nan = NaN; 34 | let inf = 1 / 0; 35 | let infStr = "Infinity"; 36 | 37 | // These 3 are going to be global variables 38 | eval('let evalVar3 = [1,2,3]'); 39 | eval('let evalVar1 = 16'); 40 | eval('let evalVar2 = "sdlfk"'); 41 | 42 | let bool = true; 43 | const fn = () => { 44 | // Some fn 45 | let xyz = 321; 46 | anotherFn(); 47 | }; 48 | let fn2 = function () { 49 | let zzz = 333; 50 | }; 51 | let qqq; 52 | let str = 'hello'; 53 | let xyz = 1; 54 | let obj = { a: 2, get thing() { throw 'xyz'; }, set thing(x) { } }; 55 | xyz++; xyz++; xyz++; 56 | 57 | let myVar = { 58 | num: 1, 59 | str: "Global", 60 | 61 | obj: { 62 | obj: { 63 | obj: { num: 10 }, 64 | obj2: { obj3: {} }, 65 | } 66 | }, 67 | obj2: { 68 | obj3: {} 69 | }, 70 | 71 | } 72 | 73 | myVar["self"] = myVar; 74 | myVar.obj["toMyVar"] = myVar; 75 | 76 | 77 | console.log('TestCode: BEFORE-VERIFYING-VARIABLES'); 78 | 79 | debugger; // Pause here to verify that we can see the values and types of all the variables 80 | break; 81 | } 82 | console.log('TestCode: END'); 83 | })(); 84 | -------------------------------------------------------------------------------- /testdata/variablesScopes/blockScope/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Hello, world!

7 | Page loaded succesfully 8 | 9 | 10 | -------------------------------------------------------------------------------- /testdata/variablesScopes/catchScope/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "Launch Chrome against localhost", 11 | "url": "http://localhost:8080", 12 | "webRoot": "${workspaceFolder}" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /testdata/variablesScopes/catchScope/catchVariablesApp.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | console.log('TestCode: START'); 3 | console.log('TestCode: BEFORE-ADDING-VARIABLES'); 4 | try { 5 | throw new Error('Something went wrong'); 6 | } catch (exception) { 7 | 8 | // Try to create a variable of each important type, to verify that we can see their contents properly 9 | 10 | const globalCode = 'page loaded'; 11 | 12 | function consoleDotLog(m) { 13 | console.log(m) 14 | } 15 | 16 | const manyPropsObj = { prop2: 'abc', prop1: 'def' }; 17 | for (let i = 0; i <= 100; i++) manyPropsObj[i] = 2 * i + 1; 18 | 19 | let r = /^asdf.*$/g; 20 | let longStr = `this is a 21 | string with 22 | newlines`; 23 | let element = document.body; 24 | const buffer = new ArrayBuffer(8); 25 | let buffView = new Int32Array(buffer); 26 | buffView[0] = 234; 27 | let s = Symbol('hi'); 28 | let e = new Error('hi'); 29 | 30 | let m = new Map(); 31 | m.set('a', 1); 32 | 33 | let b = document.body; 34 | const nan = NaN; 35 | let inf = 1 / 0; 36 | let infStr = "Infinity"; 37 | 38 | // These 3 are going to be global variables 39 | eval('let evalVar3 = [1,2,3]'); 40 | eval('let evalVar1 = 16'); 41 | eval('let evalVar2 = "sdlfk"'); 42 | 43 | let bool = true; 44 | const fn = () => { 45 | // Some fn 46 | let xyz = 321; 47 | anotherFn(); 48 | }; 49 | let fn2 = function () { 50 | let zzz = 333; 51 | }; 52 | let qqq; 53 | let str = 'hello'; 54 | let xyz = 1; 55 | let obj = { a: 2, get thing() { throw 'xyz'; }, set thing(x) { } }; 56 | xyz++; xyz++; xyz++; 57 | 58 | let myVar = { 59 | num: 1, 60 | str: "Global", 61 | 62 | obj: { 63 | obj: { 64 | obj: { num: 10 }, 65 | obj2: { obj3: {} }, 66 | } 67 | }, 68 | obj2: { 69 | obj3: {} 70 | }, 71 | 72 | } 73 | 74 | myVar["self"] = myVar; 75 | myVar.obj["toMyVar"] = myVar; 76 | 77 | 78 | console.log('TestCode: BEFORE-VERIFYING-VARIABLES'); 79 | 80 | debugger; // Pause here to verify that we can see the values and types of all the variables 81 | 82 | console.log('TestCode: END'); 83 | } 84 | })(); 85 | -------------------------------------------------------------------------------- /testdata/variablesScopes/catchScope/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Hello, world!

7 | Page loaded succesfully 8 | 9 | 10 | -------------------------------------------------------------------------------- /testdata/variablesScopes/closureScope/closureVariablesApp.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | console.log('TestCode: START'); 3 | console.log('TestCode: BEFORE-ADDING-VARIABLES'); 4 | 5 | // Try to create a variable of each important type, to verify that we can see their contents properly 6 | 7 | const globalCode = 'page loaded'; 8 | 9 | function consoleDotLog(m) { 10 | console.log(m) 11 | } 12 | 13 | const manyPropsObj = { prop2: 'abc', prop1: 'def' }; 14 | for (let i = 0; i <= 100; i++) manyPropsObj[i] = 2 * i + 1; 15 | 16 | let r = /^asdf.*$/g; 17 | let longStr = `this is a 18 | string with 19 | newlines`; 20 | let element = document.body; 21 | const buffer = new ArrayBuffer(8); 22 | let buffView = new Int32Array(buffer); 23 | buffView[0] = 234; 24 | let s = Symbol('hi'); 25 | let e = new Error('hi'); 26 | 27 | let m = new Map(); 28 | m.set('a', 1); 29 | 30 | let b = document.body; 31 | const nan = NaN; 32 | let inf = 1 / 0; 33 | let infStr = "Infinity"; 34 | 35 | // These 3 are going to be global variables 36 | eval('let evalVar3 = [1,2,3]'); 37 | eval('let evalVar1 = 16'); 38 | eval('let evalVar2 = "sdlfk"'); 39 | 40 | let bool = true; 41 | const fn = () => { 42 | // Some fn 43 | let xyz = 321; 44 | anotherFn(); 45 | }; 46 | let fn2 = function () { 47 | let zzz = 333; 48 | }; 49 | let qqq; 50 | let str = 'hello'; 51 | let xyz = 1; 52 | let obj = { a: 2, get thing() { throw 'xyz'; }, set thing(x) { } }; 53 | xyz++; xyz++; xyz++; 54 | 55 | let myVar = { 56 | num: 1, 57 | str: "Global", 58 | 59 | obj: { 60 | obj: { 61 | obj: { num: 10 }, 62 | obj2: { obj3: {} }, 63 | } 64 | }, 65 | obj2: { 66 | obj3: {} 67 | }, 68 | 69 | } 70 | 71 | myVar["self"] = myVar; 72 | myVar.obj["toMyVar"] = myVar; 73 | 74 | 75 | console.log('TestCode: BEFORE-VERIFYING-VARIABLES'); 76 | 77 | const pauseInside = function pauseInside() { 78 | debugger; // Pause here to verify that we can see the values and types of all the variables 79 | } 80 | 81 | pauseInside(); 82 | 83 | console.log('TestCode: END'); 84 | })(); 85 | -------------------------------------------------------------------------------- /testdata/variablesScopes/closureScope/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Hello, world!

7 | Page loaded succesfully 8 | 9 | 10 | -------------------------------------------------------------------------------- /testdata/variablesScopes/evalScope/evalVariablesApp.js: -------------------------------------------------------------------------------- 1 | console.log('TestCode: START'); 2 | 3 | console.log('TestCode: BEFORE-ADDING-VARIABLES'); 4 | 5 | // Try to create a variable of each important type, to verify that we can see their contents properly 6 | 7 | eval(` 8 | const globalCode = 'page loaded'; 9 | 10 | function consoleDotLog(m) { 11 | console.log(m) 12 | } 13 | 14 | const manyPropsObj = { prop2: 'abc', prop1: 'def' }; 15 | for (let i = 0; i <= 100; i++) manyPropsObj[i] = 2 * i + 1; 16 | 17 | let r = /^asdf.*$/g; 18 | let longStr = \`this is a 19 | string with 20 | newlines\`; 21 | let element = document.body; 22 | const buffer = new ArrayBuffer(8); 23 | let buffView = new Int32Array(buffer); 24 | buffView[0] = 234; 25 | let s = Symbol('hi'); 26 | let e = new Error('hi'); 27 | 28 | let m = new Map(); 29 | m.set('a', 1); 30 | 31 | let b = document.body; 32 | const nan = NaN; 33 | let inf = 1 / 0; 34 | let infStr = "Infinity"; 35 | 36 | // These 3 are going to be global variables 37 | eval('let evalVar3 = [1,2,3]'); 38 | eval('let evalVar1 = 16'); 39 | eval('let evalVar2 = "sdlfk"'); 40 | 41 | let bool = true; 42 | const fn = () => { 43 | // Some fn 44 | let xyz = 321; 45 | anotherFn(); 46 | }; 47 | let fn2 = function () { 48 | let zzz = 333; 49 | }; 50 | let qqq; 51 | let str = 'hello'; 52 | let xyz = 1; 53 | let obj = { a: 2, get thing() { throw 'xyz'; }, set thing(x) { } }; 54 | xyz++; xyz++; xyz++; 55 | 56 | let myVar = { 57 | num: 1, 58 | str: "Global", 59 | 60 | obj: { 61 | obj: { 62 | obj: { num: 10 }, 63 | obj2: { obj3: {} }, 64 | } 65 | }, 66 | obj2: { 67 | obj3: {} 68 | }, 69 | 70 | } 71 | 72 | myVar["self"] = myVar; 73 | myVar.obj["toMyVar"] = myVar; 74 | 75 | 76 | console.log('TestCode: BEFORE-VERIFYING-VARIABLES'); 77 | 78 | debugger; // Pause here to verify that we can see the values and types of all the variables 79 | `); 80 | 81 | console.log('TestCode: END'); 82 | -------------------------------------------------------------------------------- /testdata/variablesScopes/evalScope/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Hello, world!

7 | Page loaded succesfully 8 | 9 | 10 | -------------------------------------------------------------------------------- /testdata/variablesScopes/globalScope/globalVariablesApp.js: -------------------------------------------------------------------------------- 1 | console.log('TestCode: START'); 2 | 3 | debugger; // Pause here to get a list of all the "existing" global variables, so we know to ignore those 4 | 5 | console.log('TestCode: BEFORE-ADDING-VARIABLES'); 6 | 7 | // Try to create a variable of each important type, to verify that we can see their contents properly 8 | 9 | eval(` 10 | var globalCode = 'page loaded'; 11 | 12 | function consoleDotLog(m) { 13 | console.log(m) 14 | } 15 | 16 | var manyPropsObj = { prop2: 'abc', prop1: 'def' }; 17 | for (var i = 0; i <= 100; i++) manyPropsObj[i] = 2 * i + 1; 18 | 19 | var r = /^asdf.*$/g; 20 | var longStr = \`this is a 21 | string with 22 | newlines\`; 23 | var element = document.createElement("p"); 24 | var buffer = new ArrayBuffer(8); 25 | var buffView = new Int32Array(buffer); 26 | buffView[0] = 234; 27 | var s = Symbol('hi'); 28 | var e = new Error('hi'); 29 | 30 | var m = new Map(); 31 | m.set('a', 1); 32 | 33 | var b = document.body; 34 | var nan = NaN; 35 | var inf = 1 / 0; 36 | var infStr = "Infinity"; 37 | 38 | eval('var evalVar3 = [1,2,3]'); 39 | eval('var evalVar1 = 16'); 40 | eval('var evalVar2 = "sdlfk"'); 41 | 42 | var bool = true; 43 | var fn = () => { 44 | // Some fn 45 | var xyz = 321; 46 | anotherFn(); 47 | }; 48 | var fn2 = function () { 49 | var zzz = 333; 50 | }; 51 | var qqq; 52 | var str = 'hello'; 53 | var xyz = 1; 54 | var obj = { a: 2, get thing() { throw 'xyz'; }, set thing(x) { } }; 55 | xyz++; xyz++; xyz++; 56 | 57 | var myVar = { 58 | num: 1, 59 | str: "Global", 60 | 61 | obj: { 62 | obj: { 63 | obj: { num: 10 }, 64 | obj2: { obj3: {} }, 65 | } 66 | }, 67 | obj2: { 68 | obj3: {} 69 | }, 70 | 71 | } 72 | 73 | myVar["self"] = myVar; 74 | myVar.obj["toMyVar"] = myVar; 75 | `); 76 | 77 | console.log('TestCode: BEFORE-VERIFYING-VARIABLES'); 78 | 79 | debugger; // Pause here to verify that we can see the values and types of all the variables 80 | 81 | console.log('TestCode: END'); 82 | -------------------------------------------------------------------------------- /testdata/variablesScopes/globalScope/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Hello, world!

7 | Page loaded succesfully 8 | 9 | 10 | -------------------------------------------------------------------------------- /testdata/variablesScopes/localScope/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Hello, world!

7 | Page loaded succesfully 8 | 9 | 10 | -------------------------------------------------------------------------------- /testdata/variablesScopes/localScope/scriptVariablesApp.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | console.log('TestCode: START'); 3 | console.log('TestCode: BEFORE-ADDING-VARIABLES'); 4 | 5 | // Try to create a variable of each important type, to verify that we can see their contents properly 6 | 7 | const globalCode = 'page loaded'; 8 | 9 | function consoleDotLog(m) { 10 | console.log(m) 11 | } 12 | 13 | const manyPropsObj = { prop2: 'abc', prop1: 'def' }; 14 | for (let i = 0; i <= 100; i++) manyPropsObj[i] = 2 * i + 1; 15 | 16 | let r = /^asdf.*$/g; 17 | let longStr = `this is a 18 | string with 19 | newlines`; 20 | let element = document.body; 21 | const buffer = new ArrayBuffer(8); 22 | let buffView = new Int32Array(buffer); 23 | buffView[0] = 234; 24 | let s = Symbol('hi'); 25 | let e = new Error('hi'); 26 | 27 | let m = new Map(); 28 | m.set('a', 1); 29 | 30 | let b = document.body; 31 | const nan = NaN; 32 | let inf = 1 / 0; 33 | let infStr = "Infinity"; 34 | 35 | // These 3 are going to be global variables 36 | eval('let evalVar3 = [1,2,3]'); 37 | eval('let evalVar1 = 16'); 38 | eval('let evalVar2 = "sdlfk"'); 39 | 40 | let bool = true; 41 | const fn = () => { 42 | // Some fn 43 | let xyz = 321; 44 | anotherFn(); 45 | }; 46 | let fn2 = function () { 47 | let zzz = 333; 48 | }; 49 | let qqq; 50 | let str = 'hello'; 51 | let xyz = 1; 52 | let obj = { a: 2, get thing() { throw 'xyz'; }, set thing(x) { } }; 53 | xyz++; xyz++; xyz++; 54 | 55 | let myVar = { 56 | num: 1, 57 | str: "Global", 58 | 59 | obj: { 60 | obj: { 61 | obj: { num: 10 }, 62 | obj2: { obj3: {} }, 63 | } 64 | }, 65 | obj2: { 66 | obj3: {} 67 | }, 68 | 69 | } 70 | 71 | myVar["self"] = myVar; 72 | myVar.obj["toMyVar"] = myVar; 73 | 74 | 75 | console.log('TestCode: BEFORE-VERIFYING-VARIABLES'); 76 | 77 | debugger; // Pause here to verify that we can see the values and types of all the variables 78 | 79 | console.log('TestCode: END'); 80 | })(); -------------------------------------------------------------------------------- /testdata/variablesScopes/moduleScope/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Hello, world!

7 | Page loaded succesfully 8 | 9 | 10 | -------------------------------------------------------------------------------- /testdata/variablesScopes/moduleScope/moduleVariablesApp.js: -------------------------------------------------------------------------------- 1 | console.log('TestCode: START'); 2 | console.log('TestCode: BEFORE-ADDING-VARIABLES'); 3 | // Try to create a variable of each important type, to verify that we can see their contents properly 4 | export const globalCode = 'page loaded'; 5 | function consoleDotLog(m2) { 6 | console.log(m2); 7 | } 8 | export const manyPropsObj = { prop2: 'abc', prop1: 'def' }; 9 | for (let i = 0; i <= 100; i++) 10 | manyPropsObj[i] = 2 * i + 1; 11 | export let r = /^asdf.*$/g; 12 | export let longStr = `this is a 13 | string with 14 | newlines`; 15 | export let element = document.body; 16 | export const buffer = new ArrayBuffer(8); 17 | export let buffView = new Int32Array(buffer); 18 | buffView[0] = 234; 19 | export let s = Symbol('hi'); 20 | export let e = new Error('hi'); 21 | export let m = new Map(); 22 | m.set('a', 1); 23 | export let b = document.body; 24 | export const nan = NaN; 25 | export let inf = 1 / 0; 26 | export let infStr = 'Infinity'; 27 | export let bool = true; 28 | export const fn = () => { 29 | // Some fn 30 | let xyzz = 321; 31 | fn2(xyzz); 32 | }; 33 | export let fn2 = function (param) { 34 | let zzz = 333; 35 | return param + zzz; 36 | }; 37 | export let qqq; 38 | export let str = 'hello'; 39 | export let xyz = 1; 40 | export let obj = { a: 2, get thing() { throw 'xyz'; }, set thing(x) { } }; 41 | xyz++; 42 | xyz++; 43 | xyz++; 44 | export let myVar = { 45 | num: 1, 46 | str: 'Global', 47 | obj: { 48 | obj: { 49 | obj: { num: 10 }, 50 | obj2: { obj3: {} }, 51 | } 52 | }, 53 | obj2: { 54 | obj3: {} 55 | }, 56 | }; 57 | myVar['self'] = myVar; 58 | myVar.obj['toMyVar'] = myVar; 59 | console.log('TestCode: BEFORE-VERIFYING-VARIABLES'); 60 | // tslint:disable-next-line: no-debugger 61 | debugger; // Pause here to verify that we can see the values and types of all the variables 62 | console.log('TestCode: END'); 63 | -------------------------------------------------------------------------------- /testdata/variablesScopes/moduleScope/moduleVariablesApp.ts: -------------------------------------------------------------------------------- 1 | console.log('TestCode: START'); 2 | console.log('TestCode: BEFORE-ADDING-VARIABLES'); 3 | 4 | // Try to create a variable of each important type, to verify that we can see their contents properly 5 | 6 | export const globalCode = 'page loaded'; 7 | 8 | function consoleDotLog(m2: string) { 9 | console.log(m2); 10 | } 11 | 12 | export const manyPropsObj = { prop2: 'abc', prop1: 'def' }; 13 | for (let i = 0; i <= 100; i++) manyPropsObj[i] = 2 * i + 1; 14 | 15 | export let r = /^asdf.*$/g; 16 | export let longStr = `this is a 17 | string with 18 | newlines`; 19 | export let element = document.body; 20 | export const buffer = new ArrayBuffer(8); 21 | export let buffView = new Int32Array(buffer); 22 | buffView[0] = 234; 23 | export let s = Symbol('hi'); 24 | export let e = new Error('hi'); 25 | 26 | export let m = new Map(); 27 | m.set('a', 1); 28 | 29 | export let b = document.body; 30 | export const nan = NaN; 31 | export let inf = 1 / 0; 32 | export let infStr = 'Infinity'; 33 | 34 | export let bool = true; 35 | export const fn = () => { 36 | // Some fn 37 | let xyzz = 321; 38 | fn2(xyzz); 39 | }; 40 | export let fn2 = function (param) { 41 | let zzz = 333; 42 | return param + zzz; 43 | }; 44 | export let qqq; 45 | export let str = 'hello'; 46 | export let xyz = 1; 47 | export let obj = { a: 2, get thing() { throw 'xyz'; }, set thing(x) { } }; 48 | xyz++; xyz++; xyz++; 49 | 50 | export let myVar = { 51 | num: 1, 52 | str: 'Global', 53 | 54 | obj: { 55 | obj: { 56 | obj: { num: 10 }, 57 | obj2: { obj3: {} }, 58 | } 59 | }, 60 | obj2: { 61 | obj3: {} 62 | }, 63 | 64 | }; 65 | 66 | myVar['self'] = myVar; 67 | myVar.obj['toMyVar'] = myVar; 68 | 69 | 70 | console.log('TestCode: BEFORE-VERIFYING-VARIABLES'); 71 | 72 | // tslint:disable-next-line: no-debugger 73 | debugger; // Pause here to verify that we can see the values and types of all the variables 74 | 75 | console.log('TestCode: END'); 76 | -------------------------------------------------------------------------------- /testdata/variablesScopes/moduleScope/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6" 4 | } 5 | } -------------------------------------------------------------------------------- /testdata/variablesScopes/scriptScope/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Hello, world!

7 | Page loaded succesfully 8 | 9 | 10 | -------------------------------------------------------------------------------- /testdata/variablesScopes/scriptScope/scriptVariablesApp.js: -------------------------------------------------------------------------------- 1 | console.log('TestCode: START'); 2 | console.log('TestCode: BEFORE-ADDING-VARIABLES'); 3 | 4 | // Try to create a variable of each important type, to verify that we can see their contents properly 5 | 6 | const globalCode = 'page loaded'; 7 | 8 | function consoleDotLog(m) { 9 | console.log(m) 10 | } 11 | 12 | const manyPropsObj = { prop2: 'abc', prop1: 'def' }; 13 | for (let i = 0; i <= 100; i++) manyPropsObj[i] = 2 * i + 1; 14 | 15 | let r = /^asdf.*$/g; 16 | let longStr = `this is a 17 | string with 18 | newlines`; 19 | let element = document.body; 20 | const buffer = new ArrayBuffer(8); 21 | let buffView = new Int32Array(buffer); 22 | buffView[0] = 234; 23 | let s = Symbol('hi'); 24 | let e = new Error('hi'); 25 | 26 | let m = new Map(); 27 | m.set('a', 1); 28 | 29 | let b = document.body; 30 | const nan = NaN; 31 | let inf = 1 / 0; 32 | let infStr = "Infinity"; 33 | 34 | // These 3 are going to be global variables 35 | eval('let evalVar3 = [1,2,3]'); 36 | eval('let evalVar1 = 16'); 37 | eval('let evalVar2 = "sdlfk"'); 38 | 39 | let bool = true; 40 | const fn = () => { 41 | // Some fn 42 | let xyz = 321; 43 | anotherFn(); 44 | }; 45 | let fn2 = function () { 46 | let zzz = 333; 47 | }; 48 | let qqq; 49 | let str = 'hello'; 50 | let xyz = 1; 51 | let obj = { a: 2, get thing() { throw 'xyz'; }, set thing(x) { } }; 52 | xyz++; xyz++; xyz++; 53 | 54 | let myVar = { 55 | num: 1, 56 | str: "Global", 57 | 58 | obj: { 59 | obj: { 60 | obj: { num: 10 }, 61 | obj2: { obj3: {} }, 62 | } 63 | }, 64 | obj2: { 65 | obj3: {} 66 | }, 67 | 68 | } 69 | 70 | myVar["self"] = myVar; 71 | myVar.obj["toMyVar"] = myVar; 72 | 73 | 74 | console.log('TestCode: BEFORE-VERIFYING-VARIABLES'); 75 | 76 | debugger; // Pause here to verify that we can see the values and types of all the variables 77 | 78 | console.log('TestCode: END'); 79 | -------------------------------------------------------------------------------- /testdata/variablesScopes/withScope/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Hello, world!

7 | Page loaded succesfully 8 | 9 | 10 | -------------------------------------------------------------------------------- /testdata/variablesScopes/withScope/withVariablesApp.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | console.log('TestCode: START'); 3 | console.log('TestCode: BEFORE-ADDING-VARIABLES'); 4 | 5 | // Try to create a variable of each important type, to verify that we can see their contents properly 6 | 7 | const locals = {}; 8 | locals.globalCode = 'page loaded'; 9 | 10 | locals.consoleDotLog = function (m) { 11 | console.log(m) 12 | } 13 | 14 | locals.manyPropsObj = { prop2: 'abc', prop1: 'def' }; 15 | for (locals.i = 0; locals.i <= 100; locals.i++) locals.manyPropsObj[locals.i] = 2 * locals.i + 1; 16 | 17 | locals.r = /^asdf.*$/g; 18 | locals.longStr = `this is a 19 | string with 20 | newlines`; 21 | locals.element = document.body; 22 | locals.buffer = new ArrayBuffer(8); 23 | locals.buffView = new Int32Array(locals.buffer); 24 | locals.buffView[0] = 234; 25 | locals.s = Symbol('hi'); 26 | locals.e = new Error('hi'); 27 | 28 | locals.m = new Map(); 29 | locals.m.set('a', 1); 30 | 31 | locals.b = document.body; 32 | locals.nan = NaN; 33 | locals.inf = 1 / 0; 34 | locals.infStr = "Infinity"; 35 | 36 | // These 3 are going to be global variables 37 | eval('locals.evalVar3 = [1,2,3]'); 38 | eval('locals.evalVar1 = 16'); 39 | eval('locals.evalVar2 = "sdlfk"'); 40 | 41 | locals.bool = true; 42 | locals.fn = () => { 43 | // Some fn 44 | locals.xyz = 321; 45 | anotherFn(); 46 | }; 47 | locals.fn2 = function () { 48 | locals.zzz = 333; 49 | }; 50 | locals.qqq; 51 | locals.str = 'hello'; 52 | locals.xyz = 1; 53 | locals.obj = { a: 2, get thing() { throw 'xyz'; }, set thing(x) { } }; 54 | locals.xyz++; locals.xyz++; locals.xyz++; 55 | 56 | locals.myVar = { 57 | num: 1, 58 | str: "Global", 59 | 60 | obj: { 61 | obj: { 62 | obj: { num: 10 }, 63 | obj2: { obj3: {} }, 64 | } 65 | }, 66 | obj2: { 67 | obj3: {} 68 | }, 69 | 70 | } 71 | 72 | locals.myVar["self"] = locals.myVar; 73 | locals.myVar.obj["toMyVar"] = locals.myVar; 74 | 75 | console.log('TestCode: BEFORE-VERIFYING-VARIABLES'); 76 | 77 | with (locals) { 78 | debugger; // Pause here to verify that we can see the values and types of all the variables 79 | } 80 | log('TestCode: END'); 81 | })(); 82 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "noImplicitAny": false, 5 | "removeComments": false, 6 | "target": "ES6", 7 | "sourceMap": true, 8 | "outDir": "out", 9 | "noImplicitThis": true 10 | }, 11 | "exclude": [ 12 | "node_modules/", 13 | "testapp/", 14 | "testdata/" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultSeverity": "warn", 3 | "rules": { 4 | "align": [ 5 | true, 6 | "parameters", 7 | "statements" 8 | ], 9 | "ban": false, 10 | "class-name": true, 11 | "comment-format": [ 12 | true, 13 | "check-space" 14 | ], 15 | "curly": false, 16 | "forin": false, 17 | "indent": [ 18 | true, 19 | "spaces" 20 | ], 21 | "jsdoc-format": true, 22 | "label-position": true, 23 | "max-line-length": [ 24 | false, 25 | 140 26 | ], 27 | "member-access": false, 28 | "member-ordering": [ 29 | true, 30 | "variables-before-functions" 31 | ], 32 | "no-any": false, 33 | "no-arg": true, 34 | "no-bitwise": true, 35 | "no-conditional-assignment": true, 36 | "no-console": [ 37 | true, 38 | "debug", 39 | "info", 40 | "time", 41 | "timeEnd", 42 | "trace" 43 | ], 44 | "no-construct": true, 45 | "no-debugger": true, 46 | "no-duplicate-variable": true, 47 | "no-empty": false, 48 | "no-eval": true, 49 | "no-inferrable-types": false, 50 | "no-internal-module": true, 51 | "no-require-imports": false, 52 | "no-shadowed-variable": true, 53 | "no-switch-case-fall-through": true, 54 | "no-trailing-whitespace": true, 55 | "no-unused-expression": true, 56 | "no-var-keyword": true, 57 | "no-var-requires": true, 58 | "object-literal-sort-keys": false, 59 | "one-line": [ 60 | true, 61 | "check-open-brace", 62 | "check-catch", 63 | "check-else", 64 | "check-whitespace" 65 | ], 66 | "quotemark": [ 67 | true, 68 | "single", 69 | "avoid-escape" 70 | ], 71 | "radix": true, 72 | "semicolon": true, 73 | "switch-default": true, 74 | "trailing-comma": [ 75 | false, 76 | { 77 | "multiline": "always", 78 | "singleline": "never" 79 | } 80 | ], 81 | "triple-equals": [ 82 | true, 83 | "allow-null-check" 84 | ], 85 | "typedef-whitespace": [ 86 | true, 87 | { 88 | "call-signature": "nospace", 89 | "index-signature": "nospace", 90 | "parameter": "nospace", 91 | "property-declaration": "nospace", 92 | "variable-declaration": "nospace" 93 | } 94 | ], 95 | "variable-name": false, 96 | "whitespace": [ 97 | true, 98 | "check-branch", 99 | "check-decl", 100 | "check-operator", 101 | "check-separator", 102 | "check-module", 103 | "check-type" 104 | ] 105 | } 106 | } 107 | 108 | --------------------------------------------------------------------------------