From 95ead47b2113f59cf24b009d6453fa539a4fb9fc Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Mon, 18 Mar 2019 12:57:40 +0000 Subject: [PATCH 01/10] Organization changes and boiler-plate text deletion --- change-notes/1.20/analysis-python.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/change-notes/1.20/analysis-python.md b/change-notes/1.20/analysis-python.md index f6539bf761a9..26b99fe9bae7 100644 --- a/change-notes/1.20/analysis-python.md +++ b/change-notes/1.20/analysis-python.md @@ -1,10 +1,8 @@ # Improvements to Python analysis +## General improvements - ## General improvements - - > Changes that affect alerts in many files or from many queries -> For example, changes to file classification +The extractor now parses all Python code from a single unified grammar. This means that almost all Python code will be successfully parsed, even if mutually incompatible Python code is present in the same project. This also means that Python code for any version can be correctly parsed on a worker running any other supported version of Python. For example, Python 3.7 code is parsed correctly, even if the installed version of Python is only 3.5. The constants `MULTILINE` and `VERBOSE` in `re` module, are now understood for Python 3.6 and upward. Removes false positives seen when using Python 3.6, but not when using earlier versions. @@ -13,7 +11,7 @@ The API has been improved to declutter the global namespace and improve discover * The API for accessing builtin functions has been improved. Predicates of the form `theXXXFunction()`, such as `theLenFunction()`, have been deprecated in favour of `Object::builtin(name)`. * A configuration based API has been added for writing data flow and taint tracking queries. This is provided as a convenience for query authors who have written data flow or taint tracking queries for other languages, so they can use a similar format of query across multiple languages. - ## New queries +## New queries | **Query** | **Tags** | **Purpose** | |-----------------------------|-----------|--------------------------------------------------------------------| @@ -24,7 +22,7 @@ The API has been improved to declutter the global namespace and improve discover | Overly permissive file permissions (`py/overly-permissive-file`) | security, external/cwe/cwe-732 | Finds instances where a file is created with overly permissive permissions. Results are not shown on LGTM by default. | | Use of insecure SSL/TLS version (`py/insecure-protocol`) | security, external/cwe/cwe-327 | Finds instances where a known insecure protocol has been specified. Results are shown on LGTM by default. | - ## Changes to existing queries +## Changes to existing queries | **Query** | **Expected impact** | **Change** | |----------------------------|------------------------|------------------------------------------------------------------| @@ -35,11 +33,8 @@ The API has been improved to declutter the global namespace and improve discover | Unused import (`py/unused-import`) | Fewer false positive results | Results where the imported module is used in a `doctest` string are no longer reported. | | Unused import (`py/unused-import`) | Fewer false positive results | Results where the imported module is used in a type-hint comment are no longer reported. | - ## Changes to code extraction - - * The extractor now parses all Python code from a single unified grammar. This means that almost all Python code will be successfully parsed, even if mutually incompatible Python code is present in the same project. This also means that Python code for any version can be correctly parsed on a worker running any other supported version of Python. For example, Python 3.7 code is parsed correctly, even if the installed version of Python is only 3.5. - ## Changes to QL libraries +## Changes to QL libraries * Added support for the `dill` pickle library. * Added support for the `bottle` web framework. From 6cd87757f68a1c8e08c235470a9c0a088922b8ec Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Mon, 18 Mar 2019 14:36:41 +0100 Subject: [PATCH 02/10] C#: Fix a few minor performance regressions --- .../API Abuse/DisposeNotCalledOnException.ql | 20 ++++++++++++++----- .../ql/src/semmle/code/csharp/Assignable.qll | 7 ++++++- .../semmle/code/csharp/dataflow/DataFlow.qll | 1 + 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/csharp/ql/src/API Abuse/DisposeNotCalledOnException.ql b/csharp/ql/src/API Abuse/DisposeNotCalledOnException.ql index ec3db37f8bba..6b4ba7519e48 100644 --- a/csharp/ql/src/API Abuse/DisposeNotCalledOnException.ql +++ b/csharp/ql/src/API Abuse/DisposeNotCalledOnException.ql @@ -49,18 +49,28 @@ predicate isTriedAgainstException(ControlFlowElement cfe, ExceptionClass ec) { ) } +private class DisposeCall extends MethodCall { + DisposeCall() { this.getTarget() instanceof DisposeMethod } +} + +private predicate reachesDisposeCall(DisposeCall disposeCall, DataFlow::Node node) { + DataFlow::localFlowStep(node, DataFlow::exprNode(disposeCall.getQualifier())) + or + exists(DataFlow::Node mid | reachesDisposeCall(disposeCall, mid) | + DataFlow::localFlowStep(node, mid) + ) +} + /** * Holds if `disposeCall` disposes the object created by `disposableCreation`. */ -predicate disposeReachableFromDisposableCreation(MethodCall disposeCall, Expr disposableCreation) { +predicate disposeReachableFromDisposableCreation(DisposeCall disposeCall, Expr disposableCreation) { // The qualifier of the Dispose call flows from something that introduced a disposable into scope ( disposableCreation instanceof LocalScopeDisposableCreation or disposableCreation instanceof MethodCall ) and - DataFlow::localFlowStep+(DataFlow::exprNode(disposableCreation), - DataFlow::exprNode(disposeCall.getQualifier())) and - disposeCall.getTarget() instanceof DisposeMethod + reachesDisposeCall(disposeCall, DataFlow::exprNode(disposableCreation)) } class MethodCallThatMayThrow extends MethodCall { @@ -73,7 +83,7 @@ ControlFlowElement getACatchOrFinallyClauseChild() { result = getACatchOrFinallyClauseChild().getAChild() } -from MethodCall disposeCall, Expr disposableCreation, MethodCallThatMayThrow callThatThrows +from DisposeCall disposeCall, Expr disposableCreation, MethodCallThatMayThrow callThatThrows where disposeReachableFromDisposableCreation(disposeCall, disposableCreation) and // The dispose call is not, itself, within a dispose method. diff --git a/csharp/ql/src/semmle/code/csharp/Assignable.qll b/csharp/ql/src/semmle/code/csharp/Assignable.qll index 9783418475b4..14318ac37b15 100644 --- a/csharp/ql/src/semmle/code/csharp/Assignable.qll +++ b/csharp/ql/src/semmle/code/csharp/Assignable.qll @@ -76,6 +76,11 @@ class AssignableRead extends AssignableAccess { not nameOfChild(_, this) } + pragma[noinline] + private ControlFlow::Node getAnAdjacentReadSameVar() { + Ssa::Internal::adjacentReadPairSameVar(this.getAControlFlowNode(), result) + } + /** * Gets a next read of the same underlying assignable. That is, a read * that can be reached from this read without passing through any other reads, @@ -102,7 +107,7 @@ class AssignableRead extends AssignableAccess { */ AssignableRead getANextRead() { forex(ControlFlow::Node cfn | cfn = result.getAControlFlowNode() | - Ssa::Internal::adjacentReadPairSameVar(this.getAControlFlowNode(), cfn) + cfn = this.getAnAdjacentReadSameVar() ) } diff --git a/csharp/ql/src/semmle/code/csharp/dataflow/DataFlow.qll b/csharp/ql/src/semmle/code/csharp/dataflow/DataFlow.qll index f66876653d35..fd749c55f7c9 100755 --- a/csharp/ql/src/semmle/code/csharp/dataflow/DataFlow.qll +++ b/csharp/ql/src/semmle/code/csharp/dataflow/DataFlow.qll @@ -704,6 +704,7 @@ module DataFlow { ) } + pragma[nomagic] private ControlFlowElement getANonExactScopeChild(ControlFlowElement scope) { scope = getAScope(false) and result = scope From d07b958bcdc8b939f594dd7941ee459715bf27d7 Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Mon, 18 Mar 2019 15:25:46 +0000 Subject: [PATCH 03/10] Finalize text for 1.20 release --- change-notes/1.20/analysis-python.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/change-notes/1.20/analysis-python.md b/change-notes/1.20/analysis-python.md index 26b99fe9bae7..f9df8a300f1f 100644 --- a/change-notes/1.20/analysis-python.md +++ b/change-notes/1.20/analysis-python.md @@ -2,10 +2,16 @@ ## General improvements -The extractor now parses all Python code from a single unified grammar. This means that almost all Python code will be successfully parsed, even if mutually incompatible Python code is present in the same project. This also means that Python code for any version can be correctly parsed on a worker running any other supported version of Python. For example, Python 3.7 code is parsed correctly, even if the installed version of Python is only 3.5. +### Extractor changes + +The extractor now parses all Python code from a single unified grammar. This means that almost all Python code will be successfully parsed, even if mutually incompatible Python code is present in the same project. This also means that Python code for any version can be correctly parsed on a worker running any other supported version of Python. For example, Python 3.7 code is parsed correctly, even if the installed version of Python is only 3.5. This will reduce the number of syntax errors found in many projects. + +### Regular expression analysis improvements + +The Python `re` (regular expressions) module library has a couple of constants called `MULTILINE` and `VERBOSE` which determine the parsing of regular expressions. Python 3.6 changed the implementation of these constants, which resulted in false positive results for some queries. The relevant QL libraries have been updated to support both implementations which will remove false positive results from projects that use Python 3.6 and later versions. + +### API improvements -The constants `MULTILINE` and `VERBOSE` in `re` module, are now understood for Python 3.6 and upward. -Removes false positives seen when using Python 3.6, but not when using earlier versions. The API has been improved to declutter the global namespace and improve discoverability and readability. * New predicates `ModuleObject::named(name)` and `ModuleObject.attr(name)` have been added, allowing more readable access to common objects. For example, `(any ModuleObject m | m.getName() = "sys").getAttribute("exit")` can be replaced with `ModuleObject::named("sys").attr("exit")` * The API for accessing builtin functions has been improved. Predicates of the form `theXXXFunction()`, such as `theLenFunction()`, have been deprecated in favour of `Object::builtin(name)`. From 4ab8417734adbc4fbc8b1f449559fc258be4207b Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Mon, 18 Mar 2019 16:10:03 +0000 Subject: [PATCH 04/10] Fix US spelling --- change-notes/1.20/analysis-python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/change-notes/1.20/analysis-python.md b/change-notes/1.20/analysis-python.md index f9df8a300f1f..c69fbbfa30fe 100644 --- a/change-notes/1.20/analysis-python.md +++ b/change-notes/1.20/analysis-python.md @@ -14,7 +14,7 @@ The Python `re` (regular expressions) module library has a couple of constants c The API has been improved to declutter the global namespace and improve discoverability and readability. * New predicates `ModuleObject::named(name)` and `ModuleObject.attr(name)` have been added, allowing more readable access to common objects. For example, `(any ModuleObject m | m.getName() = "sys").getAttribute("exit")` can be replaced with `ModuleObject::named("sys").attr("exit")` - * The API for accessing builtin functions has been improved. Predicates of the form `theXXXFunction()`, such as `theLenFunction()`, have been deprecated in favour of `Object::builtin(name)`. + * The API for accessing builtin functions has been improved. Predicates of the form `theXXXFunction()`, such as `theLenFunction()`, have been deprecated in favor of `Object::builtin(name)`. * A configuration based API has been added for writing data flow and taint tracking queries. This is provided as a convenience for query authors who have written data flow or taint tracking queries for other languages, so they can use a similar format of query across multiple languages. ## New queries From 5031153ba2e0c08489e89ca5f794ddc2e7400ed6 Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Mon, 18 Mar 2019 16:17:20 +0000 Subject: [PATCH 05/10] Update JavaScript extraction notes and supported versions --- change-notes/1.20/extractor-javascript.md | 24 ++++--------------- .../1.20/support/versions-compilers.csv | 2 +- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/change-notes/1.20/extractor-javascript.md b/change-notes/1.20/extractor-javascript.md index b233e167faf7..a0d59b9f747c 100644 --- a/change-notes/1.20/extractor-javascript.md +++ b/change-notes/1.20/extractor-javascript.md @@ -2,25 +2,11 @@ # Improvements to JavaScript analysis -> NOTES -> -> Please describe your changes in terms that are suitable for -> customers to read. These notes will have only minor tidying up -> before they are published as part of the release notes. -> -> This file is written for lgtm users and should contain *only* -> notes about changes that affect lgtm enterprise users. Add -> any other customer-facing changes to the `studio-java.md` -> file. -> - -## General improvements - ## Changes to code extraction * Parallel extraction of JavaScript files (but not TypeScript files) on LGTM is now supported. The `LGTM_THREADS` environment variable can be set to indicate how many files should be extracted in parallel. If this variable is not set, parallel extraction is disabled. -* The extractor now offers experimental support for [E4X](https://developer.mozilla.org/en-US/docs/Archive/Web/E4X), a legacy language extension developed by Mozilla. -* The extractor now supports additional [Flow](https://flow.org/) syntax. -* The extractor now supports [Nullish Coalescing](https://github.com/tc39/proposal-nullish-coalescing) expressions. -* The extractor now supports [TypeScript 3.2](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-2.html). -* The TypeScript extractor now handles the control-flow of logical operators and destructuring assignments more accurately. +* Experimental support for [E4X](https://developer.mozilla.org/en-US/docs/Archive/Web/E4X), a legacy language extension developed by Mozilla, is available. +* Additional [Flow](https://flow.org/) syntax is now supported. +* [Nullish Coalescing](https://github.com/tc39/proposal-nullish-coalescing) expressions are now supported. +* [TypeScript 3.2](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-2.html) is now supported. +* The TypeScript extractor now handles the control flow of logical operators and destructuring assignments more accurately. diff --git a/change-notes/1.20/support/versions-compilers.csv b/change-notes/1.20/support/versions-compilers.csv index fb903ca08a61..51b07b98aa37 100644 --- a/change-notes/1.20/support/versions-compilers.csv +++ b/change-notes/1.20/support/versions-compilers.csv @@ -13,4 +13,4 @@ Java,"Java 11 [2]_. or lower","javac (OpenJDK and Oracle JDK) Eclipse compiler for Java (ECJ) batch compiler",``.java`` JavaScript,ECMAScript 2018 or lower,Not applicable,"``.js``, ``.jsx``, ``.mjs``, ``.es``, ``.es6``, ``.htm``, ``.html``, ``.xhm``, ``.xhtml``, ``.vue``, ``.json`` [3]_." Python,"2.7, 3.5, 3.6, 3.7",Not applicable,``.py`` -TypeScript [4]_.,"2.6, 2.7, 2.8, 2.9, 3.0, 3.1",Standard TypeScript compiler,"``.ts``, ``.tsx``" +TypeScript [4]_.,"2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2",Standard TypeScript compiler,"``.ts``, ``.tsx``" From 06fcd8a150a54e3281e14d6a5dbd1c8edee700a1 Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Mon, 18 Mar 2019 17:07:58 +0000 Subject: [PATCH 06/10] Reword information on parallel extraction --- change-notes/1.20/extractor-javascript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/change-notes/1.20/extractor-javascript.md b/change-notes/1.20/extractor-javascript.md index a0d59b9f747c..eee09113ebbb 100644 --- a/change-notes/1.20/extractor-javascript.md +++ b/change-notes/1.20/extractor-javascript.md @@ -4,7 +4,7 @@ ## Changes to code extraction -* Parallel extraction of JavaScript files (but not TypeScript files) on LGTM is now supported. The `LGTM_THREADS` environment variable can be set to indicate how many files should be extracted in parallel. If this variable is not set, parallel extraction is disabled. +* Parallel extraction of JavaScript files (but not TypeScript files) on LGTM is now supported. If LGTM is configured to evaluate queries using multiple threads, then JavaScript files are also extracted using multiple threads. * Experimental support for [E4X](https://developer.mozilla.org/en-US/docs/Archive/Web/E4X), a legacy language extension developed by Mozilla, is available. * Additional [Flow](https://flow.org/) syntax is now supported. * [Nullish Coalescing](https://github.com/tc39/proposal-nullish-coalescing) expressions are now supported. From aaa8bfb874961c04f581f48a1e514196636eda42 Mon Sep 17 00:00:00 2001 From: Asger F Date: Wed, 20 Mar 2019 10:08:45 +0000 Subject: [PATCH 07/10] TS: allow namespace imports as types --- .../src/com/semmle/js/extractor/ASTExtractor.java | 9 +-------- .../extractor/src/com/semmle/js/extractor/Main.java | 2 +- .../src/com/semmle/js/extractor/ScopeManager.java | 5 +---- javascript/ql/src/semmle/javascript/TypeScript.qll | 2 +- .../Declarations/UnusedVariable/UnusedVariable.expected | 1 + .../Declarations/UnusedVariable/namespaceImportAsType.ts | 9 +++++++++ 6 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 javascript/ql/test/query-tests/Declarations/UnusedVariable/namespaceImportAsType.ts diff --git a/javascript/extractor/src/com/semmle/js/extractor/ASTExtractor.java b/javascript/extractor/src/com/semmle/js/extractor/ASTExtractor.java index 662fbefca02e..b37657b85b4f 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/ASTExtractor.java +++ b/javascript/extractor/src/com/semmle/js/extractor/ASTExtractor.java @@ -42,7 +42,6 @@ import com.semmle.js.ast.Identifier; import com.semmle.js.ast.IfStatement; import com.semmle.js.ast.ImportDeclaration; -import com.semmle.js.ast.ImportNamespaceSpecifier; import com.semmle.js.ast.ImportSpecifier; import com.semmle.js.ast.InvokeExpression; import com.semmle.js.ast.JumpStatement; @@ -1449,13 +1448,7 @@ public Label visit(ImportDeclaration nd, Context c) { public Label visit(ImportSpecifier nd, Context c) { Label lbl = super.visit(nd, c); visit(nd.getImported(), lbl, 0, IdContext.label); - visit( - nd.getLocal(), - lbl, - 1, - nd instanceof ImportNamespaceSpecifier - ? IdContext.varAndNamespaceDecl - : IdContext.varAndTypeAndNamespaceDecl); + visit(nd.getLocal(), lbl, 1, IdContext.varAndTypeAndNamespaceDecl); return lbl; } diff --git a/javascript/extractor/src/com/semmle/js/extractor/Main.java b/javascript/extractor/src/com/semmle/js/extractor/Main.java index 1a5f92ca4ae5..7b0700a55cf1 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/Main.java +++ b/javascript/extractor/src/com/semmle/js/extractor/Main.java @@ -37,7 +37,7 @@ public class Main { * A version identifier that should be updated every time the extractor changes in such a way that * it may produce different tuples for the same file under the same {@link ExtractorConfig}. */ - public static final String EXTRACTOR_VERSION = "2019-03-13"; + public static final String EXTRACTOR_VERSION = "2019-03-20"; public static final Pattern NEWLINE = Pattern.compile("\n"); diff --git a/javascript/extractor/src/com/semmle/js/extractor/ScopeManager.java b/javascript/extractor/src/com/semmle/js/extractor/ScopeManager.java index 8c9902c03bf7..1270b0a94092 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/ScopeManager.java +++ b/javascript/extractor/src/com/semmle/js/extractor/ScopeManager.java @@ -17,7 +17,6 @@ import com.semmle.js.ast.Identifier; import com.semmle.js.ast.IfStatement; import com.semmle.js.ast.ImportDeclaration; -import com.semmle.js.ast.ImportNamespaceSpecifier; import com.semmle.js.ast.ImportSpecifier; import com.semmle.js.ast.LabeledStatement; import com.semmle.js.ast.LetExpression; @@ -559,9 +558,7 @@ public Void visit(ImportDeclaration nd, Void c) { @Override public Void visit(ImportSpecifier nd, Void c) { - return visit( - nd.getLocal(), - nd instanceof ImportNamespaceSpecifier ? DeclKind.varAndNamespace : DeclKind.all); + return visit(nd.getLocal(), DeclKind.all); } @Override diff --git a/javascript/ql/src/semmle/javascript/TypeScript.qll b/javascript/ql/src/semmle/javascript/TypeScript.qll index eae336817718..9104d4d343f8 100644 --- a/javascript/ql/src/semmle/javascript/TypeScript.qll +++ b/javascript/ql/src/semmle/javascript/TypeScript.qll @@ -359,7 +359,7 @@ class TypeDecl extends Identifier, TypeRef, LexicalDecl { TypeDecl() { this = any(ClassOrInterface ci).getIdentifier() or this = any(TypeParameter tp).getIdentifier() or - this = any(ImportSpecifier im | not im instanceof ImportNamespaceSpecifier).getLocal() or + this = any(ImportSpecifier im).getLocal() or this = any(ImportEqualsDeclaration im).getId() or this = any(TypeAliasDeclaration td).getIdentifier() or this = any(EnumDeclaration ed).getIdentifier() or diff --git a/javascript/ql/test/query-tests/Declarations/UnusedVariable/UnusedVariable.expected b/javascript/ql/test/query-tests/Declarations/UnusedVariable/UnusedVariable.expected index 30ab3133bca8..9db0d903c2d0 100644 --- a/javascript/ql/test/query-tests/Declarations/UnusedVariable/UnusedVariable.expected +++ b/javascript/ql/test/query-tests/Declarations/UnusedVariable/UnusedVariable.expected @@ -7,6 +7,7 @@ | importWithoutPragma.jsx:1:1:1:27 | import ... react'; | Unused import h. | | multi-imports.js:1:1:1:29 | import ... om 'x'; | Unused imports a, b, d. | | multi-imports.js:2:1:2:42 | import ... om 'x'; | Unused imports alphabetically, ordered. | +| namespaceImportAsType.ts:3:1:3:23 | import ... om "z"; | Unused import Z. | | require-react-in-other-scope.js:2:9:2:13 | React | Unused variable React. | | typeoftype.ts:9:7:9:7 | y | Unused variable y. | | underscore.js:6:7:6:7 | e | Unused variable e. | diff --git a/javascript/ql/test/query-tests/Declarations/UnusedVariable/namespaceImportAsType.ts b/javascript/ql/test/query-tests/Declarations/UnusedVariable/namespaceImportAsType.ts new file mode 100644 index 000000000000..8749b3b059e4 --- /dev/null +++ b/javascript/ql/test/query-tests/Declarations/UnusedVariable/namespaceImportAsType.ts @@ -0,0 +1,9 @@ +import * as X from "x"; // OK +import * as Y from "y"; // OK +import * as Z from "z"; // NOT OK + +function f(x: X) {} +function g(x: Y.T) {} + +f(null); +g(null); From 8201e7ea27f55d0633b007f66f7d63823be37875 Mon Sep 17 00:00:00 2001 From: Asger F Date: Wed, 20 Mar 2019 10:23:28 +0000 Subject: [PATCH 08/10] TS: update trap test output --- .../tests/es2015/output/trap/import5.js.trap | 74 +++---- .../esnext/output/trap/yield-import.js.trap | 188 +++--------------- .../tests/ts/output/trap/importExport.ts.trap | 164 +++++++-------- 3 files changed, 150 insertions(+), 276 deletions(-) diff --git a/javascript/extractor/tests/es2015/output/trap/import5.js.trap b/javascript/extractor/tests/es2015/output/trap/import5.js.trap index ea5ea8a38363..c686a83cb668 100644 --- a/javascript/extractor/tests/es2015/output/trap/import5.js.trap +++ b/javascript/extractor/tests/es2015/output/trap/import5.js.trap @@ -65,45 +65,49 @@ isModule(#20001) isES2015Module(#20001) #20021=@"var;{foo};{#20020}" variables(#20021,"foo",#20020) -#20022=@"local_namespace_name;{foo};{#20020}" -local_namespace_names(#20022,"foo",#20020) +#20022=@"local_type_name;{foo};{#20020}" +local_type_names(#20022,"foo",#20020) +#20023=@"local_namespace_name;{foo};{#20020}" +local_namespace_names(#20023,"foo",#20020) variables(#20021,"foo",#20020) -local_namespace_names(#20022,"foo",#20020) -#20023=* -stmts(#20023,27,#20001,0,"import ... 'foo';") -hasLocation(#20023,#20003) -stmtContainers(#20023,#20001) +local_type_names(#20022,"foo",#20020) +local_namespace_names(#20023,"foo",#20020) #20024=* -exprs(#20024,4,#20023,-1,"'foo'") -hasLocation(#20024,#20015) -enclosingStmt(#20024,#20023) -exprContainers(#20024,#20001) -literals("foo","'foo'",#20024) +stmts(#20024,27,#20001,0,"import ... 'foo';") +hasLocation(#20024,#20003) +stmtContainers(#20024,#20001) #20025=* -exprs(#20025,85,#20023,0,"* as foo") -#20026=@"loc,{#10000},1,8,1,15" -locations_default(#20026,#10000,1,8,1,15) -hasLocation(#20025,#20026) -enclosingStmt(#20025,#20023) +exprs(#20025,4,#20024,-1,"'foo'") +hasLocation(#20025,#20015) +enclosingStmt(#20025,#20024) exprContainers(#20025,#20001) -#20027=* -exprs(#20027,78,#20025,1,"foo") -hasLocation(#20027,#20011) -enclosingStmt(#20027,#20023) -exprContainers(#20027,#20001) -literals("foo","foo",#20027) -decl(#20027,#20021) -namespacedecl(#20027,#20022) +literals("foo","'foo'",#20025) +#20026=* +exprs(#20026,85,#20024,0,"* as foo") +#20027=@"loc,{#10000},1,8,1,15" +locations_default(#20027,#10000,1,8,1,15) +hasLocation(#20026,#20027) +enclosingStmt(#20026,#20024) +exprContainers(#20026,#20001) #20028=* -entry_cfg_node(#20028,#20001) -#20029=@"loc,{#10000},1,1,1,0" -locations_default(#20029,#10000,1,1,1,0) -hasLocation(#20028,#20029) -#20030=* -exit_cfg_node(#20030,#20001) -hasLocation(#20030,#20019) -successor(#20023,#20030) -successor(#20025,#20023) -successor(#20028,#20025) +exprs(#20028,78,#20026,1,"foo") +hasLocation(#20028,#20011) +enclosingStmt(#20028,#20024) +exprContainers(#20028,#20001) +literals("foo","foo",#20028) +decl(#20028,#20021) +typedecl(#20028,#20022) +namespacedecl(#20028,#20023) +#20029=* +entry_cfg_node(#20029,#20001) +#20030=@"loc,{#10000},1,1,1,0" +locations_default(#20030,#10000,1,1,1,0) +hasLocation(#20029,#20030) +#20031=* +exit_cfg_node(#20031,#20001) +hasLocation(#20031,#20019) +successor(#20024,#20031) +successor(#20026,#20024) +successor(#20029,#20026) numlines(#10000,1,1,0) filetype(#10000,"javascript") diff --git a/javascript/extractor/tests/esnext/output/trap/yield-import.js.trap b/javascript/extractor/tests/esnext/output/trap/yield-import.js.trap index 54996ba291ed..1dc036e0f15d 100644 --- a/javascript/extractor/tests/esnext/output/trap/yield-import.js.trap +++ b/javascript/extractor/tests/esnext/output/trap/yield-import.js.trap @@ -9,169 +9,35 @@ hasLocation(#10000,#10002) #20000=@"global_scope" scopes(#20000,0) #20001=@"script;{#10000},1,1" -#20002=* -lines(#20002,#20001,"function* f() {"," +toplevels(#20001,0) +#20002=@"loc,{#10000},1,1,1,1" +locations_default(#20002,#10000,1,1,1,1) +hasLocation(#20001,#20002) +#20003=* +jsParseErrors(#20003,#20001,"Error: Unexpected token"," yield import(""foo"") +") +#20004=@"loc,{#10000},2,9,2,9" +locations_default(#20004,#10000,2,9,2,9) +hasLocation(#20003,#20004) +#20005=* +lines(#20005,#20001,"function* f() {"," ") -#20003=@"loc,{#10000},1,1,1,15" -locations_default(#20003,#10000,1,1,1,15) -hasLocation(#20002,#20003) -#20004=* -lines(#20004,#20001," yield import(""foo"")"," +#20006=@"loc,{#10000},1,1,1,15" +locations_default(#20006,#10000,1,1,1,15) +hasLocation(#20005,#20006) +#20007=* +lines(#20007,#20001," yield import(""foo"")"," ") -#20005=@"loc,{#10000},2,1,2,21" -locations_default(#20005,#10000,2,1,2,21) -hasLocation(#20004,#20005) +#20008=@"loc,{#10000},2,1,2,21" +locations_default(#20008,#10000,2,1,2,21) +hasLocation(#20007,#20008) indentation(#10000,2," ",2) -#20006=* -lines(#20006,#20001,"}"," +#20009=* +lines(#20009,#20001,"}"," ") -#20007=@"loc,{#10000},3,1,3,1" -locations_default(#20007,#10000,3,1,3,1) -hasLocation(#20006,#20007) -numlines(#20001,3,3,0) -#20008=* -tokeninfo(#20008,7,#20001,0,"function") -#20009=@"loc,{#10000},1,1,1,8" -locations_default(#20009,#10000,1,1,1,8) -hasLocation(#20008,#20009) -#20010=* -tokeninfo(#20010,8,#20001,1,"*") -#20011=@"loc,{#10000},1,9,1,9" -locations_default(#20011,#10000,1,9,1,9) -hasLocation(#20010,#20011) -#20012=* -tokeninfo(#20012,6,#20001,2,"f") -#20013=@"loc,{#10000},1,11,1,11" -locations_default(#20013,#10000,1,11,1,11) -hasLocation(#20012,#20013) -#20014=* -tokeninfo(#20014,8,#20001,3,"(") -#20015=@"loc,{#10000},1,12,1,12" -locations_default(#20015,#10000,1,12,1,12) -hasLocation(#20014,#20015) -#20016=* -tokeninfo(#20016,8,#20001,4,")") -#20017=@"loc,{#10000},1,13,1,13" -locations_default(#20017,#10000,1,13,1,13) -hasLocation(#20016,#20017) -#20018=* -tokeninfo(#20018,8,#20001,5,"{") -#20019=@"loc,{#10000},1,15,1,15" -locations_default(#20019,#10000,1,15,1,15) -hasLocation(#20018,#20019) -#20020=* -tokeninfo(#20020,7,#20001,6,"yield") -#20021=@"loc,{#10000},2,3,2,7" -locations_default(#20021,#10000,2,3,2,7) -hasLocation(#20020,#20021) -#20022=* -tokeninfo(#20022,7,#20001,7,"import") -#20023=@"loc,{#10000},2,9,2,14" -locations_default(#20023,#10000,2,9,2,14) -hasLocation(#20022,#20023) -#20024=* -tokeninfo(#20024,8,#20001,8,"(") -#20025=@"loc,{#10000},2,15,2,15" -locations_default(#20025,#10000,2,15,2,15) -hasLocation(#20024,#20025) -#20026=* -tokeninfo(#20026,4,#20001,9,"""foo""") -#20027=@"loc,{#10000},2,16,2,20" -locations_default(#20027,#10000,2,16,2,20) -hasLocation(#20026,#20027) -#20028=* -tokeninfo(#20028,8,#20001,10,")") -#20029=@"loc,{#10000},2,21,2,21" -locations_default(#20029,#10000,2,21,2,21) -hasLocation(#20028,#20029) -#20030=* -tokeninfo(#20030,8,#20001,11,"}") -hasLocation(#20030,#20007) -#20031=* -tokeninfo(#20031,0,#20001,12,"") -#20032=@"loc,{#10000},4,1,4,0" -locations_default(#20032,#10000,4,1,4,0) -hasLocation(#20031,#20032) -toplevels(#20001,0) -#20033=@"loc,{#10000},1,1,4,0" -locations_default(#20033,#10000,1,1,4,0) -hasLocation(#20001,#20033) -#20034=@"var;{f};{#20000}" -variables(#20034,"f",#20000) -#20035=* -stmts(#20035,17,#20001,0,"functio ... foo"")\n}") -#20036=@"loc,{#10000},1,1,3,1" -locations_default(#20036,#10000,1,1,3,1) -hasLocation(#20035,#20036) -stmtContainers(#20035,#20001) -#20037=* -exprs(#20037,78,#20035,-1,"f") -hasLocation(#20037,#20013) -exprContainers(#20037,#20035) -literals("f","f",#20037) -decl(#20037,#20034) -#20038=* -scopes(#20038,1) -scopenodes(#20035,#20038) -scopenesting(#20038,#20000) -#20039=@"var;{arguments};{#20038}" -variables(#20039,"arguments",#20038) -isArgumentsObject(#20039) -isGenerator(#20035) -#20040=* -stmts(#20040,1,#20035,-2,"{\n yie ... foo"")\n}") -#20041=@"loc,{#10000},1,15,3,1" -locations_default(#20041,#10000,1,15,3,1) -hasLocation(#20040,#20041) -stmtContainers(#20040,#20035) -#20042=* -stmts(#20042,2,#20040,0,"yield import(""foo"")") -#20043=@"loc,{#10000},2,3,2,21" -locations_default(#20043,#10000,2,3,2,21) -hasLocation(#20042,#20043) -stmtContainers(#20042,#20035) -#20044=* -exprs(#20044,69,#20042,0,"yield import(""foo"")") -hasLocation(#20044,#20043) -enclosingStmt(#20044,#20042) -exprContainers(#20044,#20035) -#20045=* -exprs(#20045,99,#20044,0,"import(""foo"")") -#20046=@"loc,{#10000},2,9,2,21" -locations_default(#20046,#10000,2,9,2,21) -hasLocation(#20045,#20046) -enclosingStmt(#20045,#20042) -exprContainers(#20045,#20035) -#20047=* -exprs(#20047,4,#20045,0,"""foo""") -hasLocation(#20047,#20027) -enclosingStmt(#20047,#20042) -exprContainers(#20047,#20035) -literals("foo","""foo""",#20047) -#20048=* -entry_cfg_node(#20048,#20001) -#20049=@"loc,{#10000},1,1,1,0" -locations_default(#20049,#10000,1,1,1,0) -hasLocation(#20048,#20049) -#20050=* -exit_cfg_node(#20050,#20001) -hasLocation(#20050,#20032) -successor(#20035,#20050) -#20051=* -entry_cfg_node(#20051,#20035) -hasLocation(#20051,#20049) -#20052=* -exit_cfg_node(#20052,#20035) -#20053=@"loc,{#10000},3,2,3,1" -locations_default(#20053,#10000,3,2,3,1) -hasLocation(#20052,#20053) -successor(#20040,#20042) -successor(#20042,#20047) -successor(#20047,#20045) -successor(#20045,#20044) -successor(#20044,#20052) -successor(#20051,#20040) -successor(#20037,#20035) -successor(#20048,#20037) -numlines(#10000,3,3,0) +#20010=@"loc,{#10000},3,1,3,1" +locations_default(#20010,#10000,3,1,3,1) +hasLocation(#20009,#20010) +numlines(#20001,3,0,0) +numlines(#10000,3,0,0) filetype(#10000,"javascript") diff --git a/javascript/extractor/tests/ts/output/trap/importExport.ts.trap b/javascript/extractor/tests/ts/output/trap/importExport.ts.trap index 4b9267996c07..3f28897f7b9f 100644 --- a/javascript/extractor/tests/ts/output/trap/importExport.ts.trap +++ b/javascript/extractor/tests/ts/output/trap/importExport.ts.trap @@ -122,98 +122,102 @@ isES2015Module(#20001) variables(#20042,"Something",#20041) #20043=@"var;{importExport};{#20041}" variables(#20043,"importExport",#20041) -#20044=@"local_type_name;{importExport};{#20041}" -local_type_names(#20044,"importExport",#20041) -#20045=@"local_namespace_name;{Something};{#20041}" -local_namespace_names(#20045,"Something",#20041) -#20046=@"local_namespace_name;{importExport};{#20041}" -local_namespace_names(#20046,"importExport",#20041) +#20044=@"local_type_name;{Something};{#20041}" +local_type_names(#20044,"Something",#20041) +#20045=@"local_type_name;{importExport};{#20041}" +local_type_names(#20045,"importExport",#20041) +#20046=@"local_namespace_name;{Something};{#20041}" +local_namespace_names(#20046,"Something",#20041) +#20047=@"local_namespace_name;{importExport};{#20041}" +local_namespace_names(#20047,"importExport",#20041) variables(#20042,"Something",#20041) variables(#20043,"importExport",#20041) -local_type_names(#20044,"importExport",#20041) -local_namespace_names(#20045,"Something",#20041) -local_namespace_names(#20046,"importExport",#20041) -#20047=* -stmts(#20047,27,#20001,0,"import ... where';") -hasLocation(#20047,#20003) -stmtContainers(#20047,#20001) +local_type_names(#20044,"Something",#20041) +local_type_names(#20045,"importExport",#20041) +local_namespace_names(#20046,"Something",#20041) +local_namespace_names(#20047,"importExport",#20041) #20048=* -exprs(#20048,4,#20047,-1,"'somewhere'") -hasLocation(#20048,#20019) -enclosingStmt(#20048,#20047) -exprContainers(#20048,#20001) -literals("somewhere","'somewhere'",#20048) +stmts(#20048,27,#20001,0,"import ... where';") +hasLocation(#20048,#20003) +stmtContainers(#20048,#20001) #20049=* -exprs(#20049,85,#20047,0,"* as Something") -#20050=@"loc,{#10000},1,8,1,21" -locations_default(#20050,#10000,1,8,1,21) -hasLocation(#20049,#20050) -enclosingStmt(#20049,#20047) +exprs(#20049,4,#20048,-1,"'somewhere'") +hasLocation(#20049,#20019) +enclosingStmt(#20049,#20048) exprContainers(#20049,#20001) -#20051=* -exprs(#20051,78,#20049,1,"Something") -hasLocation(#20051,#20015) -enclosingStmt(#20051,#20047) -exprContainers(#20051,#20001) -literals("Something","Something",#20051) -decl(#20051,#20042) -namespacedecl(#20051,#20045) +literals("somewhere","'somewhere'",#20049) +#20050=* +exprs(#20050,85,#20048,0,"* as Something") +#20051=@"loc,{#10000},1,8,1,21" +locations_default(#20051,#10000,1,8,1,21) +hasLocation(#20050,#20051) +enclosingStmt(#20050,#20048) +exprContainers(#20050,#20001) #20052=* -stmts(#20052,30,#20001,1,"export ... thingy;") -hasLocation(#20052,#20007) -stmtContainers(#20052,#20001) +exprs(#20052,78,#20050,1,"Something") +hasLocation(#20052,#20015) +enclosingStmt(#20052,#20048) +exprContainers(#20052,#20001) +literals("Something","Something",#20052) +decl(#20052,#20042) +typedecl(#20052,#20044) +namespacedecl(#20052,#20046) #20053=* -stmts(#20053,32,#20052,-1,"import ... thingy;") -#20054=@"loc,{#10000},3,8,3,46" -locations_default(#20054,#10000,3,8,3,46) -hasLocation(#20053,#20054) +stmts(#20053,30,#20001,1,"export ... thingy;") +hasLocation(#20053,#20007) stmtContainers(#20053,#20001) -#20055=* -exprs(#20055,78,#20053,0,"importExport") -hasLocation(#20055,#20027) -enclosingStmt(#20055,#20053) -exprContainers(#20055,#20001) -literals("importExport","importExport",#20055) -decl(#20055,#20043) -typedecl(#20055,#20044) -namespacedecl(#20055,#20046) +#20054=* +stmts(#20054,32,#20053,-1,"import ... thingy;") +#20055=@"loc,{#10000},3,8,3,46" +locations_default(#20055,#10000,3,8,3,46) +hasLocation(#20054,#20055) +stmtContainers(#20054,#20001) #20056=* -exprs(#20056,14,#20053,1,"Something.thingy") -#20057=@"loc,{#10000},3,30,3,45" -locations_default(#20057,#10000,3,30,3,45) -hasLocation(#20056,#20057) -enclosingStmt(#20056,#20053) +exprs(#20056,78,#20054,0,"importExport") +hasLocation(#20056,#20027) +enclosingStmt(#20056,#20054) exprContainers(#20056,#20001) -#20058=* -exprs(#20058,103,#20056,0,"Something") -hasLocation(#20058,#20031) -enclosingStmt(#20058,#20053) -exprContainers(#20058,#20001) -literals("Something","Something",#20058) -namespacebind(#20058,#20045) -bind(#20058,#20042) +literals("importExport","importExport",#20056) +decl(#20056,#20043) +typedecl(#20056,#20045) +namespacedecl(#20056,#20047) +#20057=* +exprs(#20057,14,#20054,1,"Something.thingy") +#20058=@"loc,{#10000},3,30,3,45" +locations_default(#20058,#10000,3,30,3,45) +hasLocation(#20057,#20058) +enclosingStmt(#20057,#20054) +exprContainers(#20057,#20001) #20059=* -exprs(#20059,0,#20056,1,"thingy") -hasLocation(#20059,#20035) -enclosingStmt(#20059,#20053) +exprs(#20059,103,#20057,0,"Something") +hasLocation(#20059,#20031) +enclosingStmt(#20059,#20054) exprContainers(#20059,#20001) -literals("thingy","thingy",#20059) +literals("Something","Something",#20059) +namespacebind(#20059,#20046) +bind(#20059,#20042) #20060=* -entry_cfg_node(#20060,#20001) -#20061=@"loc,{#10000},1,1,1,0" -locations_default(#20061,#10000,1,1,1,0) -hasLocation(#20060,#20061) -#20062=* -exit_cfg_node(#20062,#20001) -hasLocation(#20062,#20039) -successor(#20052,#20055) -successor(#20059,#20056) -successor(#20058,#20059) -successor(#20056,#20053) -successor(#20055,#20058) -successor(#20053,#20062) -successor(#20047,#20052) -successor(#20049,#20047) -successor(#20060,#20049) +exprs(#20060,0,#20057,1,"thingy") +hasLocation(#20060,#20035) +enclosingStmt(#20060,#20054) +exprContainers(#20060,#20001) +literals("thingy","thingy",#20060) +#20061=* +entry_cfg_node(#20061,#20001) +#20062=@"loc,{#10000},1,1,1,0" +locations_default(#20062,#10000,1,1,1,0) +hasLocation(#20061,#20062) +#20063=* +exit_cfg_node(#20063,#20001) +hasLocation(#20063,#20039) +successor(#20053,#20056) +successor(#20060,#20057) +successor(#20059,#20060) +successor(#20057,#20054) +successor(#20056,#20059) +successor(#20054,#20063) +successor(#20048,#20053) +successor(#20050,#20048) +successor(#20061,#20050) numlines(#10000,3,2,0) filetype(#10000,"typescript") From 5768d85c7bb70c89788df8dae9d9839b5a9b6579 Mon Sep 17 00:00:00 2001 From: Asger F Date: Wed, 20 Mar 2019 12:46:52 +0000 Subject: [PATCH 09/10] TS: fix trap test output --- .../esnext/output/trap/yield-import.js.trap | 188 +++++++++++++++--- 1 file changed, 161 insertions(+), 27 deletions(-) diff --git a/javascript/extractor/tests/esnext/output/trap/yield-import.js.trap b/javascript/extractor/tests/esnext/output/trap/yield-import.js.trap index 1dc036e0f15d..54996ba291ed 100644 --- a/javascript/extractor/tests/esnext/output/trap/yield-import.js.trap +++ b/javascript/extractor/tests/esnext/output/trap/yield-import.js.trap @@ -9,35 +9,169 @@ hasLocation(#10000,#10002) #20000=@"global_scope" scopes(#20000,0) #20001=@"script;{#10000},1,1" -toplevels(#20001,0) -#20002=@"loc,{#10000},1,1,1,1" -locations_default(#20002,#10000,1,1,1,1) -hasLocation(#20001,#20002) -#20003=* -jsParseErrors(#20003,#20001,"Error: Unexpected token"," yield import(""foo"") -") -#20004=@"loc,{#10000},2,9,2,9" -locations_default(#20004,#10000,2,9,2,9) -hasLocation(#20003,#20004) -#20005=* -lines(#20005,#20001,"function* f() {"," +#20002=* +lines(#20002,#20001,"function* f() {"," ") -#20006=@"loc,{#10000},1,1,1,15" -locations_default(#20006,#10000,1,1,1,15) -hasLocation(#20005,#20006) -#20007=* -lines(#20007,#20001," yield import(""foo"")"," +#20003=@"loc,{#10000},1,1,1,15" +locations_default(#20003,#10000,1,1,1,15) +hasLocation(#20002,#20003) +#20004=* +lines(#20004,#20001," yield import(""foo"")"," ") -#20008=@"loc,{#10000},2,1,2,21" -locations_default(#20008,#10000,2,1,2,21) -hasLocation(#20007,#20008) +#20005=@"loc,{#10000},2,1,2,21" +locations_default(#20005,#10000,2,1,2,21) +hasLocation(#20004,#20005) indentation(#10000,2," ",2) -#20009=* -lines(#20009,#20001,"}"," +#20006=* +lines(#20006,#20001,"}"," ") -#20010=@"loc,{#10000},3,1,3,1" -locations_default(#20010,#10000,3,1,3,1) -hasLocation(#20009,#20010) -numlines(#20001,3,0,0) -numlines(#10000,3,0,0) +#20007=@"loc,{#10000},3,1,3,1" +locations_default(#20007,#10000,3,1,3,1) +hasLocation(#20006,#20007) +numlines(#20001,3,3,0) +#20008=* +tokeninfo(#20008,7,#20001,0,"function") +#20009=@"loc,{#10000},1,1,1,8" +locations_default(#20009,#10000,1,1,1,8) +hasLocation(#20008,#20009) +#20010=* +tokeninfo(#20010,8,#20001,1,"*") +#20011=@"loc,{#10000},1,9,1,9" +locations_default(#20011,#10000,1,9,1,9) +hasLocation(#20010,#20011) +#20012=* +tokeninfo(#20012,6,#20001,2,"f") +#20013=@"loc,{#10000},1,11,1,11" +locations_default(#20013,#10000,1,11,1,11) +hasLocation(#20012,#20013) +#20014=* +tokeninfo(#20014,8,#20001,3,"(") +#20015=@"loc,{#10000},1,12,1,12" +locations_default(#20015,#10000,1,12,1,12) +hasLocation(#20014,#20015) +#20016=* +tokeninfo(#20016,8,#20001,4,")") +#20017=@"loc,{#10000},1,13,1,13" +locations_default(#20017,#10000,1,13,1,13) +hasLocation(#20016,#20017) +#20018=* +tokeninfo(#20018,8,#20001,5,"{") +#20019=@"loc,{#10000},1,15,1,15" +locations_default(#20019,#10000,1,15,1,15) +hasLocation(#20018,#20019) +#20020=* +tokeninfo(#20020,7,#20001,6,"yield") +#20021=@"loc,{#10000},2,3,2,7" +locations_default(#20021,#10000,2,3,2,7) +hasLocation(#20020,#20021) +#20022=* +tokeninfo(#20022,7,#20001,7,"import") +#20023=@"loc,{#10000},2,9,2,14" +locations_default(#20023,#10000,2,9,2,14) +hasLocation(#20022,#20023) +#20024=* +tokeninfo(#20024,8,#20001,8,"(") +#20025=@"loc,{#10000},2,15,2,15" +locations_default(#20025,#10000,2,15,2,15) +hasLocation(#20024,#20025) +#20026=* +tokeninfo(#20026,4,#20001,9,"""foo""") +#20027=@"loc,{#10000},2,16,2,20" +locations_default(#20027,#10000,2,16,2,20) +hasLocation(#20026,#20027) +#20028=* +tokeninfo(#20028,8,#20001,10,")") +#20029=@"loc,{#10000},2,21,2,21" +locations_default(#20029,#10000,2,21,2,21) +hasLocation(#20028,#20029) +#20030=* +tokeninfo(#20030,8,#20001,11,"}") +hasLocation(#20030,#20007) +#20031=* +tokeninfo(#20031,0,#20001,12,"") +#20032=@"loc,{#10000},4,1,4,0" +locations_default(#20032,#10000,4,1,4,0) +hasLocation(#20031,#20032) +toplevels(#20001,0) +#20033=@"loc,{#10000},1,1,4,0" +locations_default(#20033,#10000,1,1,4,0) +hasLocation(#20001,#20033) +#20034=@"var;{f};{#20000}" +variables(#20034,"f",#20000) +#20035=* +stmts(#20035,17,#20001,0,"functio ... foo"")\n}") +#20036=@"loc,{#10000},1,1,3,1" +locations_default(#20036,#10000,1,1,3,1) +hasLocation(#20035,#20036) +stmtContainers(#20035,#20001) +#20037=* +exprs(#20037,78,#20035,-1,"f") +hasLocation(#20037,#20013) +exprContainers(#20037,#20035) +literals("f","f",#20037) +decl(#20037,#20034) +#20038=* +scopes(#20038,1) +scopenodes(#20035,#20038) +scopenesting(#20038,#20000) +#20039=@"var;{arguments};{#20038}" +variables(#20039,"arguments",#20038) +isArgumentsObject(#20039) +isGenerator(#20035) +#20040=* +stmts(#20040,1,#20035,-2,"{\n yie ... foo"")\n}") +#20041=@"loc,{#10000},1,15,3,1" +locations_default(#20041,#10000,1,15,3,1) +hasLocation(#20040,#20041) +stmtContainers(#20040,#20035) +#20042=* +stmts(#20042,2,#20040,0,"yield import(""foo"")") +#20043=@"loc,{#10000},2,3,2,21" +locations_default(#20043,#10000,2,3,2,21) +hasLocation(#20042,#20043) +stmtContainers(#20042,#20035) +#20044=* +exprs(#20044,69,#20042,0,"yield import(""foo"")") +hasLocation(#20044,#20043) +enclosingStmt(#20044,#20042) +exprContainers(#20044,#20035) +#20045=* +exprs(#20045,99,#20044,0,"import(""foo"")") +#20046=@"loc,{#10000},2,9,2,21" +locations_default(#20046,#10000,2,9,2,21) +hasLocation(#20045,#20046) +enclosingStmt(#20045,#20042) +exprContainers(#20045,#20035) +#20047=* +exprs(#20047,4,#20045,0,"""foo""") +hasLocation(#20047,#20027) +enclosingStmt(#20047,#20042) +exprContainers(#20047,#20035) +literals("foo","""foo""",#20047) +#20048=* +entry_cfg_node(#20048,#20001) +#20049=@"loc,{#10000},1,1,1,0" +locations_default(#20049,#10000,1,1,1,0) +hasLocation(#20048,#20049) +#20050=* +exit_cfg_node(#20050,#20001) +hasLocation(#20050,#20032) +successor(#20035,#20050) +#20051=* +entry_cfg_node(#20051,#20035) +hasLocation(#20051,#20049) +#20052=* +exit_cfg_node(#20052,#20035) +#20053=@"loc,{#10000},3,2,3,1" +locations_default(#20053,#10000,3,2,3,1) +hasLocation(#20052,#20053) +successor(#20040,#20042) +successor(#20042,#20047) +successor(#20047,#20045) +successor(#20045,#20044) +successor(#20044,#20052) +successor(#20051,#20040) +successor(#20037,#20035) +successor(#20048,#20037) +numlines(#10000,3,3,0) filetype(#10000,"javascript") From 1a6c95c908b3c2b9f18670be9362972323f2ff3a Mon Sep 17 00:00:00 2001 From: Asger F Date: Thu, 21 Mar 2019 11:06:04 +0000 Subject: [PATCH 10/10] TS: update test expectation --- .../TypeScript/LocalTypeResolution/ResolveTypeNames.expected | 1 + 1 file changed, 1 insertion(+) diff --git a/javascript/ql/test/library-tests/TypeScript/LocalTypeResolution/ResolveTypeNames.expected b/javascript/ql/test/library-tests/TypeScript/LocalTypeResolution/ResolveTypeNames.expected index d97404e26ac7..43ba306f202c 100644 --- a/javascript/ql/test/library-tests/TypeScript/LocalTypeResolution/ResolveTypeNames.expected +++ b/javascript/ql/test/library-tests/TypeScript/LocalTypeResolution/ResolveTypeNames.expected @@ -4,6 +4,7 @@ | exports.ts:16:5:16:8 | Enum | exports.ts:7:6:7:9 | Enum | | namespaceDecls.ts:38:8:38:8 | A | namespaceDecls.ts:1:8:1:8 | A | | namespaceDecls.ts:38:8:38:8 | A | namespaceDecls.ts:6:11:6:11 | A | +| namespaceDecls.ts:39:8:39:8 | E | namespaceDecls.ts:4:13:4:13 | E | | namespaceDecls.ts:39:8:39:8 | E | namespaceDecls.ts:7:11:7:11 | E | | tst.ts:6:9:6:9 | I | tst.ts:4:11:4:11 | I | | tst.ts:8:11:8:11 | I | tst.ts:4:11:4:11 | I |