mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
@@ -35,6 +35,7 @@ import com.semmle.js.ast.jsx.JSXMemberExpression;
|
||||
import com.semmle.js.ast.jsx.JSXNamespacedName;
|
||||
import com.semmle.js.ast.jsx.JSXOpeningElement;
|
||||
import com.semmle.js.ast.jsx.JSXSpreadAttribute;
|
||||
import com.semmle.js.ast.jsx.JSXThisExpr;
|
||||
import com.semmle.util.data.Either;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -225,22 +226,26 @@ public class JSXParser extends Parser {
|
||||
}
|
||||
|
||||
/** Parse next token as JSX identifier */
|
||||
private JSXIdentifier jsx_parseIdentifier() {
|
||||
private IJSXName jsx_parseIdentifier(boolean expectThisExpr) {
|
||||
SourceLocation loc = new SourceLocation(this.startLoc);
|
||||
String name = null;
|
||||
if (this.type == jsxName) name = String.valueOf(this.value);
|
||||
else if (this.type.keyword != null) name = this.type.keyword;
|
||||
else this.unexpected();
|
||||
this.next();
|
||||
if (expectThisExpr && name.equals("this")) {
|
||||
return this.finishNode(new JSXThisExpr(loc));
|
||||
} else {
|
||||
return this.finishNode(new JSXIdentifier(loc, name));
|
||||
}
|
||||
}
|
||||
|
||||
/** Parse namespaced identifier. */
|
||||
private IJSXName jsx_parseNamespacedName() {
|
||||
SourceLocation loc = new SourceLocation(this.startLoc);
|
||||
JSXIdentifier namespace = this.jsx_parseIdentifier();
|
||||
if (!((JSXOptions) options).allowNamespaces || !this.eat(colon)) return namespace;
|
||||
return this.finishNode(new JSXNamespacedName(loc, namespace, this.jsx_parseIdentifier()));
|
||||
IJSXName namespace = this.jsx_parseIdentifier(true);
|
||||
if (namespace instanceof JSXThisExpr || (!((JSXOptions) options).allowNamespaces || !this.eat(colon))) return namespace;
|
||||
return this.finishNode(new JSXNamespacedName(loc, (JSXIdentifier)namespace, (JSXIdentifier)this.jsx_parseIdentifier(false)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -258,7 +263,7 @@ public class JSXParser extends Parser {
|
||||
}
|
||||
while (this.eat(dot)) {
|
||||
SourceLocation loc = new SourceLocation(startPos);
|
||||
node = this.finishNode(new JSXMemberExpression(loc, node, this.jsx_parseIdentifier()));
|
||||
node = this.finishNode(new JSXMemberExpression(loc, node, (JSXIdentifier)this.jsx_parseIdentifier(false)));
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.semmle.js.ast.jsx.JSXMemberExpression;
|
||||
import com.semmle.js.ast.jsx.JSXNamespacedName;
|
||||
import com.semmle.js.ast.jsx.JSXOpeningElement;
|
||||
import com.semmle.js.ast.jsx.JSXSpreadAttribute;
|
||||
import com.semmle.js.ast.jsx.JSXThisExpr;
|
||||
import com.semmle.ts.ast.ExportWholeDeclaration;
|
||||
import com.semmle.ts.ast.ExternalModuleReference;
|
||||
import com.semmle.ts.ast.ImportWholeDeclaration;
|
||||
@@ -635,6 +636,11 @@ public class AST2JSON extends DefaultVisitor<Void, JsonElement> {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonElement visit(JSXThisExpr nd, Void c) {
|
||||
return this.mkNode(nd, "JSXThisExpr");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonElement visit(JSXMemberExpression nd, Void c) {
|
||||
JsonObject result = this.mkNode(nd);
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.semmle.js.ast.jsx.JSXMemberExpression;
|
||||
import com.semmle.js.ast.jsx.JSXNamespacedName;
|
||||
import com.semmle.js.ast.jsx.JSXOpeningElement;
|
||||
import com.semmle.js.ast.jsx.JSXSpreadAttribute;
|
||||
import com.semmle.js.ast.jsx.JSXThisExpr;
|
||||
import com.semmle.ts.ast.ArrayTypeExpr;
|
||||
import com.semmle.ts.ast.ConditionalTypeExpr;
|
||||
import com.semmle.ts.ast.DecoratorList;
|
||||
@@ -498,6 +499,11 @@ public class DefaultVisitor<C, R> implements Visitor<C, R> {
|
||||
return visit((IJSXName) nd, c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R visit(JSXThisExpr nd, C c) {
|
||||
return visit((IJSXName) nd, c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R visit(JSXMemberExpression nd, C c) {
|
||||
return visit((IJSXName) nd, c);
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.semmle.js.ast.jsx.JSXMemberExpression;
|
||||
import com.semmle.js.ast.jsx.JSXNamespacedName;
|
||||
import com.semmle.js.ast.jsx.JSXOpeningElement;
|
||||
import com.semmle.js.ast.jsx.JSXSpreadAttribute;
|
||||
import com.semmle.js.ast.jsx.JSXThisExpr;
|
||||
import com.semmle.ts.ast.ArrayTypeExpr;
|
||||
import com.semmle.ts.ast.ConditionalTypeExpr;
|
||||
import com.semmle.ts.ast.DecoratorList;
|
||||
@@ -567,6 +568,11 @@ public class NodeCopier implements Visitor<Void, INode> {
|
||||
return new JSXIdentifier(visit(nd.getLoc()), nd.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public INode visit(JSXThisExpr nd, Void c) {
|
||||
return new JSXThisExpr(visit(nd.getLoc()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public INode visit(JSXMemberExpression nd, Void c) {
|
||||
return new JSXMemberExpression(visit(nd.getLoc()), copy(nd.getObject()), copy(nd.getName()));
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.semmle.js.ast.jsx.JSXMemberExpression;
|
||||
import com.semmle.js.ast.jsx.JSXNamespacedName;
|
||||
import com.semmle.js.ast.jsx.JSXOpeningElement;
|
||||
import com.semmle.js.ast.jsx.JSXSpreadAttribute;
|
||||
import com.semmle.js.ast.jsx.JSXThisExpr;
|
||||
import com.semmle.ts.ast.ArrayTypeExpr;
|
||||
import com.semmle.ts.ast.ConditionalTypeExpr;
|
||||
import com.semmle.ts.ast.DecoratorList;
|
||||
@@ -200,6 +201,8 @@ public interface Visitor<C, R> {
|
||||
|
||||
public R visit(JSXIdentifier nd, C c);
|
||||
|
||||
public R visit(JSXThisExpr nd, C c);
|
||||
|
||||
public R visit(JSXMemberExpression nd, C c);
|
||||
|
||||
public R visit(JSXNamespacedName nd, C c);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.semmle.js.ast.jsx;
|
||||
|
||||
import com.semmle.js.ast.ThisExpression;
|
||||
import com.semmle.js.ast.SourceLocation;
|
||||
import com.semmle.js.ast.Visitor;
|
||||
|
||||
public class JSXThisExpr extends ThisExpression implements IJSXName {
|
||||
public JSXThisExpr(SourceLocation loc) {
|
||||
super(loc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <C, R> R accept(Visitor<C, R> v, C c) {
|
||||
return v.visit(this, c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQualifiedName() {
|
||||
return "this";
|
||||
}
|
||||
}
|
||||
@@ -82,6 +82,7 @@ import com.semmle.js.ast.SwitchStatement;
|
||||
import com.semmle.js.ast.TaggedTemplateExpression;
|
||||
import com.semmle.js.ast.TemplateElement;
|
||||
import com.semmle.js.ast.TemplateLiteral;
|
||||
import com.semmle.js.ast.ThisExpression;
|
||||
import com.semmle.js.ast.ThrowStatement;
|
||||
import com.semmle.js.ast.TryStatement;
|
||||
import com.semmle.js.ast.UnaryExpression;
|
||||
@@ -105,6 +106,7 @@ import com.semmle.js.ast.jsx.JSXMemberExpression;
|
||||
import com.semmle.js.ast.jsx.JSXNamespacedName;
|
||||
import com.semmle.js.ast.jsx.JSXOpeningElement;
|
||||
import com.semmle.js.ast.jsx.JSXSpreadAttribute;
|
||||
import com.semmle.js.ast.jsx.JSXThisExpr;
|
||||
import com.semmle.js.extractor.ExtractionMetrics.ExtractionPhase;
|
||||
import com.semmle.js.extractor.ExtractorConfig.Platform;
|
||||
import com.semmle.js.extractor.ExtractorConfig.SourceType;
|
||||
@@ -1645,6 +1647,11 @@ public class ASTExtractor {
|
||||
return visit((Identifier) nd, c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Label visit(JSXThisExpr nd, Context c) {
|
||||
return visit((ThisExpression) nd, c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Label visit(JSXMemberExpression nd, Context c) {
|
||||
Label key = super.visit(nd, c);
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.semmle.js.ast.Literal;
|
||||
import com.semmle.js.ast.LogicalExpression;
|
||||
import com.semmle.js.ast.MemberExpression;
|
||||
import com.semmle.js.ast.MetaProperty;
|
||||
import com.semmle.js.ast.ThisExpression;
|
||||
import com.semmle.js.ast.UnaryExpression;
|
||||
import com.semmle.js.ast.UpdateExpression;
|
||||
import com.semmle.js.ast.XMLAnyName;
|
||||
@@ -28,6 +29,7 @@ import com.semmle.js.ast.XMLQualifiedIdentifier;
|
||||
import com.semmle.js.ast.jsx.JSXIdentifier;
|
||||
import com.semmle.js.ast.jsx.JSXMemberExpression;
|
||||
import com.semmle.js.ast.jsx.JSXSpreadAttribute;
|
||||
import com.semmle.js.ast.jsx.JSXThisExpr;
|
||||
import com.semmle.js.extractor.ASTExtractor.IdContext;
|
||||
import com.semmle.ts.ast.DecoratorList;
|
||||
import com.semmle.ts.ast.ExpressionWithTypeArguments;
|
||||
@@ -191,6 +193,11 @@ public class ExprKinds {
|
||||
return visit((Identifier) nd, c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer visit(JSXThisExpr nd, Void c) {
|
||||
return visit((ThisExpression) nd, c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer visit(LogicalExpression nd, Void q) {
|
||||
return binOpKinds.get(nd.getOperator());
|
||||
|
||||
@@ -110,6 +110,7 @@ import com.semmle.js.ast.jsx.JSXIdentifier;
|
||||
import com.semmle.js.ast.jsx.JSXMemberExpression;
|
||||
import com.semmle.js.ast.jsx.JSXOpeningElement;
|
||||
import com.semmle.js.ast.jsx.JSXSpreadAttribute;
|
||||
import com.semmle.js.ast.jsx.JSXThisExpr;
|
||||
import com.semmle.js.parser.JSParser.Result;
|
||||
import com.semmle.ts.ast.ArrayTypeExpr;
|
||||
import com.semmle.ts.ast.ConditionalTypeExpr;
|
||||
@@ -2356,7 +2357,7 @@ public class TypeScriptASTConverter {
|
||||
convertJSXName(me.getObject()),
|
||||
(JSXIdentifier) convertJSXName(me.getProperty()));
|
||||
}
|
||||
if (e instanceof ThisExpression) return new JSXIdentifier(e.getLoc(), "this");
|
||||
if (e instanceof ThisExpression) return new JSXThisExpr(e.getLoc());
|
||||
return (IJSXName) e;
|
||||
}
|
||||
|
||||
|
||||
@@ -301,94 +301,90 @@ hasLocation(#20099,#20100)
|
||||
enclosingStmt(#20099,#20077)
|
||||
exprContainers(#20099,#20001)
|
||||
#20101=*
|
||||
exprs(#20101,79,#20099,0,"this")
|
||||
exprs(#20101,6,#20099,0,"this")
|
||||
hasLocation(#20101,#20039)
|
||||
enclosingStmt(#20101,#20077)
|
||||
exprContainers(#20101,#20001)
|
||||
literals("this","this",#20101)
|
||||
#20102=@"var;{this};{#20000}"
|
||||
variables(#20102,"this",#20000)
|
||||
bind(#20101,#20102)
|
||||
#20102=*
|
||||
exprs(#20102,0,#20099,1,"props")
|
||||
hasLocation(#20102,#20043)
|
||||
enclosingStmt(#20102,#20077)
|
||||
exprContainers(#20102,#20001)
|
||||
literals("props","props",#20102)
|
||||
#20103=*
|
||||
exprs(#20103,0,#20099,1,"props")
|
||||
hasLocation(#20103,#20043)
|
||||
exprs(#20103,0,#20097,1,"icon")
|
||||
hasLocation(#20103,#20047)
|
||||
enclosingStmt(#20103,#20077)
|
||||
exprContainers(#20103,#20001)
|
||||
literals("props","props",#20103)
|
||||
literals("icon","icon",#20103)
|
||||
#20104=*
|
||||
exprs(#20104,0,#20097,1,"icon")
|
||||
hasLocation(#20104,#20047)
|
||||
exprs(#20104,4,#20079,-4,"")
|
||||
#20105=@"loc,{#10000},3,3,3,2"
|
||||
locations_default(#20105,#10000,3,3,3,2)
|
||||
hasLocation(#20104,#20105)
|
||||
enclosingStmt(#20104,#20077)
|
||||
exprContainers(#20104,#20001)
|
||||
literals("icon","icon",#20104)
|
||||
#20105=*
|
||||
exprs(#20105,4,#20079,-4,"")
|
||||
#20106=@"loc,{#10000},3,3,3,2"
|
||||
locations_default(#20106,#10000,3,3,3,2)
|
||||
hasLocation(#20105,#20106)
|
||||
enclosingStmt(#20105,#20077)
|
||||
exprContainers(#20105,#20001)
|
||||
literals("
|
||||
","",#20105)
|
||||
#20107=*
|
||||
regexpterm(#20107,14,#20105,0,"
|
||||
","",#20104)
|
||||
#20106=*
|
||||
regexpterm(#20106,14,#20104,0,"
|
||||
")
|
||||
#20108=@"loc,{#10000},3,4,3,6"
|
||||
locations_default(#20108,#10000,3,4,3,6)
|
||||
hasLocation(#20107,#20108)
|
||||
regexpConstValue(#20107,"
|
||||
#20107=@"loc,{#10000},3,4,3,6"
|
||||
locations_default(#20107,#10000,3,4,3,6)
|
||||
hasLocation(#20106,#20107)
|
||||
regexpConstValue(#20106,"
|
||||
")
|
||||
#20109=*
|
||||
exprs(#20109,89,#20079,-5,"<name-with-dashes/>")
|
||||
#20110=@"loc,{#10000},3,3,3,21"
|
||||
locations_default(#20110,#10000,3,3,3,21)
|
||||
hasLocation(#20109,#20110)
|
||||
enclosingStmt(#20109,#20077)
|
||||
exprContainers(#20109,#20001)
|
||||
#20111=*
|
||||
exprs(#20111,0,#20109,-1,"name-with-dashes")
|
||||
#20112=@"loc,{#10000},3,4,3,19"
|
||||
locations_default(#20112,#10000,3,4,3,19)
|
||||
hasLocation(#20111,#20112)
|
||||
enclosingStmt(#20111,#20077)
|
||||
exprContainers(#20111,#20001)
|
||||
literals("name-with-dashes","name-with-dashes",#20111)
|
||||
#20113=*
|
||||
exprs(#20113,4,#20079,-6,"")
|
||||
#20114=@"loc,{#10000},4,1,4,0"
|
||||
locations_default(#20114,#10000,4,1,4,0)
|
||||
hasLocation(#20113,#20114)
|
||||
enclosingStmt(#20113,#20077)
|
||||
exprContainers(#20113,#20001)
|
||||
#20108=*
|
||||
exprs(#20108,89,#20079,-5,"<name-with-dashes/>")
|
||||
#20109=@"loc,{#10000},3,3,3,21"
|
||||
locations_default(#20109,#10000,3,3,3,21)
|
||||
hasLocation(#20108,#20109)
|
||||
enclosingStmt(#20108,#20077)
|
||||
exprContainers(#20108,#20001)
|
||||
#20110=*
|
||||
exprs(#20110,0,#20108,-1,"name-with-dashes")
|
||||
#20111=@"loc,{#10000},3,4,3,19"
|
||||
locations_default(#20111,#10000,3,4,3,19)
|
||||
hasLocation(#20110,#20111)
|
||||
enclosingStmt(#20110,#20077)
|
||||
exprContainers(#20110,#20001)
|
||||
literals("name-with-dashes","name-with-dashes",#20110)
|
||||
#20112=*
|
||||
exprs(#20112,4,#20079,-6,"")
|
||||
#20113=@"loc,{#10000},4,1,4,0"
|
||||
locations_default(#20113,#10000,4,1,4,0)
|
||||
hasLocation(#20112,#20113)
|
||||
enclosingStmt(#20112,#20077)
|
||||
exprContainers(#20112,#20001)
|
||||
literals("
|
||||
","",#20113)
|
||||
#20115=*
|
||||
regexpterm(#20115,14,#20113,0,"
|
||||
","",#20112)
|
||||
#20114=*
|
||||
regexpterm(#20114,14,#20112,0,"
|
||||
")
|
||||
#20116=@"loc,{#10000},4,2,4,2"
|
||||
locations_default(#20116,#10000,4,2,4,2)
|
||||
hasLocation(#20115,#20116)
|
||||
regexpConstValue(#20115,"
|
||||
#20115=@"loc,{#10000},4,2,4,2"
|
||||
locations_default(#20115,#10000,4,2,4,2)
|
||||
hasLocation(#20114,#20115)
|
||||
regexpConstValue(#20114,"
|
||||
")
|
||||
#20117=*
|
||||
entry_cfg_node(#20117,#20001)
|
||||
#20118=@"loc,{#10000},1,1,1,0"
|
||||
locations_default(#20118,#10000,1,1,1,0)
|
||||
hasLocation(#20117,#20118)
|
||||
#20119=*
|
||||
exit_cfg_node(#20119,#20001)
|
||||
hasLocation(#20119,#20075)
|
||||
#20116=*
|
||||
entry_cfg_node(#20116,#20001)
|
||||
#20117=@"loc,{#10000},1,1,1,0"
|
||||
locations_default(#20117,#10000,1,1,1,0)
|
||||
hasLocation(#20116,#20117)
|
||||
#20118=*
|
||||
exit_cfg_node(#20118,#20001)
|
||||
hasLocation(#20118,#20075)
|
||||
successor(#20077,#20080)
|
||||
successor(#20113,#20079)
|
||||
successor(#20111,#20109)
|
||||
successor(#20109,#20113)
|
||||
successor(#20105,#20111)
|
||||
successor(#20104,#20097)
|
||||
successor(#20103,#20099)
|
||||
successor(#20101,#20103)
|
||||
successor(#20099,#20104)
|
||||
successor(#20112,#20079)
|
||||
successor(#20110,#20108)
|
||||
successor(#20108,#20112)
|
||||
successor(#20104,#20110)
|
||||
successor(#20103,#20097)
|
||||
successor(#20102,#20099)
|
||||
successor(#20101,#20102)
|
||||
successor(#20099,#20103)
|
||||
successor(#20097,#20095)
|
||||
successor(#20095,#20105)
|
||||
successor(#20095,#20104)
|
||||
successor(#20091,#20101)
|
||||
successor(#20089,#20086)
|
||||
successor(#20088,#20089)
|
||||
@@ -397,7 +393,7 @@ successor(#20084,#20081)
|
||||
successor(#20083,#20084)
|
||||
successor(#20081,#20088)
|
||||
successor(#20080,#20083)
|
||||
successor(#20079,#20119)
|
||||
successor(#20117,#20077)
|
||||
successor(#20079,#20118)
|
||||
successor(#20116,#20077)
|
||||
numlines(#10000,4,4,0)
|
||||
filetype(#10000,"typescript")
|
||||
|
||||
@@ -181,6 +181,7 @@ class JSXQualifiedName extends Expr, @jsxqualifiedname {
|
||||
class JSXName extends Expr {
|
||||
JSXName() {
|
||||
this instanceof Identifier or
|
||||
this instanceof ThisExpr or
|
||||
this.(DotExpr).getBase() instanceof JSXName or
|
||||
this instanceof JSXQualifiedName
|
||||
}
|
||||
@@ -198,6 +199,9 @@ class JSXName extends Expr {
|
||||
exists(JSXQualifiedName qual | qual = this |
|
||||
result = qual.getNamespace().getName() + ":" + qual.getName().getName()
|
||||
)
|
||||
or
|
||||
this instanceof ThisExpr and
|
||||
result = "this"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import semmle.javascript.frameworks.React
|
||||
|
||||
query predicate test_JSXname(JSXElement element, JSXName jsxname, string name, string type) {
|
||||
name = jsxname.getValue() and
|
||||
(
|
||||
jsxname instanceof Identifier and type = "Identifier"
|
||||
or
|
||||
jsxname instanceof ThisExpr and type = "thisExpr"
|
||||
or
|
||||
jsxname.(DotExpr).getBase() instanceof JSXName and type = "dot"
|
||||
or
|
||||
jsxname instanceof JSXQualifiedName and type = "qualifiedName"
|
||||
) and
|
||||
element.getNameExpr() = jsxname
|
||||
}
|
||||
|
||||
query ThisExpr test_JSXName_this(JSXElement element) { result.getParentExpr+() = element }
|
||||
@@ -35,6 +35,7 @@ test_ReactComponent_getInstanceMethod
|
||||
| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | someInstanceMethod | thisAccesses.js:26:25:28:5 | functio ... ;\\n } |
|
||||
| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | render | thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} |
|
||||
| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | render | thisAccesses.js:39:13:44:5 | functio ... ;\\n } |
|
||||
| thisAccesses.js:54:1:63:1 | class C ... }\\n} | render | thisAccesses.js:59:11:62:5 | () {\\n ... ;\\n } |
|
||||
| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | render | thisAccesses_importedMappers.js:5:13:14:5 | functio ... ;\\n } |
|
||||
test_react
|
||||
| es5.js:1:13:1:17 | React |
|
||||
@@ -70,6 +71,7 @@ test_react
|
||||
| thisAccesses.js:38:1:38:5 | React |
|
||||
| thisAccesses.js:40:9:40:13 | React |
|
||||
| thisAccesses.js:47:18:47:22 | React |
|
||||
| thisAccesses.js:54:18:54:22 | React |
|
||||
| thisAccesses_importedMappers.js:1:8:1:12 | React |
|
||||
| thisAccesses_importedMappers.js:4:1:4:5 | React |
|
||||
| thisAccesses_importedMappers.js:6:9:6:13 | React |
|
||||
@@ -165,6 +167,10 @@ test_ReactComponent_ref
|
||||
| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:48:17:48:16 | this |
|
||||
| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:49:9:49:12 | this |
|
||||
| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:50:9:50:12 | this |
|
||||
| thisAccesses.js:54:1:63:1 | class C ... }\\n} | thisAccesses.js:55:16:55:15 | this |
|
||||
| thisAccesses.js:54:1:63:1 | class C ... }\\n} | thisAccesses.js:59:11:59:10 | this |
|
||||
| thisAccesses.js:54:1:63:1 | class C ... }\\n} | thisAccesses.js:60:20:60:23 | this |
|
||||
| thisAccesses.js:54:1:63:1 | class C ... }\\n} | thisAccesses.js:61:20:61:23 | this |
|
||||
| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} |
|
||||
| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:5:13:5:12 | this |
|
||||
| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:6:38:6:37 | this |
|
||||
@@ -248,6 +254,7 @@ test_ReactComponent
|
||||
| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} |
|
||||
| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} |
|
||||
| thisAccesses.js:47:1:52:1 | class C ... }\\n} |
|
||||
| thisAccesses.js:54:1:63:1 | class C ... }\\n} |
|
||||
| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} |
|
||||
test_ReactComponent_getAPropRead
|
||||
| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | name | es5.js:4:24:4:38 | this.props.name |
|
||||
@@ -258,3 +265,30 @@ test_ReactComponent_getAPropRead
|
||||
| preact.js:1:1:7:1 | class H ... }\\n} | name | preact.js:3:9:3:18 | props.name |
|
||||
| probably-a-component.js:1:1:6:1 | class H ... }\\n} | name | probably-a-component.js:3:9:3:23 | this.props.name |
|
||||
| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | name | statePropertyWrites.js:38:24:38:38 | this.props.name |
|
||||
test_JSXname
|
||||
| es5.js:4:12:4:45 | <div>He ... }</div> | es5.js:4:13:4:15 | div | div | Identifier |
|
||||
| es5.js:20:12:20:44 | <h1>Hel ... e}</h1> | es5.js:20:13:20:14 | h1 | h1 | Identifier |
|
||||
| es6.js:3:12:3:45 | <div>He ... }</div> | es6.js:3:13:3:15 | div | div | Identifier |
|
||||
| exportedComponent.jsx:2:12:2:46 | <div st ... lor}}/> | exportedComponent.jsx:2:13:2:15 | div | div | Identifier |
|
||||
| importedComponent.jsx:4:12:4:39 | <MyComp ... olor}/> | importedComponent.jsx:4:13:4:23 | MyComponent | MyComponent | Identifier |
|
||||
| plainfn.js:2:10:2:38 | <div>He ... }</div> | plainfn.js:2:11:2:13 | div | div | Identifier |
|
||||
| preact.js:5:16:5:21 | <div/> | preact.js:5:17:5:19 | div | div | Identifier |
|
||||
| probably-a-component.js:4:16:4:21 | <div/> | probably-a-component.js:4:17:4:19 | div | div | Identifier |
|
||||
| props.js:7:6:7:37 | <C prop ... JSX"}/> | props.js:7:7:7:7 | C | C | Identifier |
|
||||
| props.js:19:6:19:37 | <C prop ... JSX"}/> | props.js:19:7:19:7 | C | C | Identifier |
|
||||
| props.js:27:16:27:21 | <div/> | props.js:27:17:27:19 | div | div | Identifier |
|
||||
| props.js:32:6:32:37 | <C prop ... JSX"}/> | props.js:32:7:32:7 | C | C | Identifier |
|
||||
| statePropertyWrites.js:38:12:38:45 | <div>He ... }</div> | statePropertyWrites.js:38:13:38:15 | div | div | Identifier |
|
||||
| thisAccesses.js:23:16:23:21 | <div/> | thisAccesses.js:23:17:23:19 | div | div | Identifier |
|
||||
| thisAccesses.js:35:12:35:17 | <div/> | thisAccesses.js:35:13:35:15 | div | div | Identifier |
|
||||
| thisAccesses.js:43:16:43:21 | <div/> | thisAccesses.js:43:17:43:19 | div | div | Identifier |
|
||||
| thisAccesses.js:60:19:60:41 | <this.n ... s.name> | thisAccesses.js:60:20:60:28 | this.name | this.name | dot |
|
||||
| thisAccesses.js:61:19:61:41 | <this.t ... s.this> | thisAccesses.js:61:20:61:28 | this.this | this.this | dot |
|
||||
| thisAccesses_importedMappers.js:13:16:13:21 | <div/> | thisAccesses_importedMappers.js:13:17:13:19 | div | div | Identifier |
|
||||
test_JSXName_this
|
||||
| es5.js:4:12:4:45 | <div>He ... }</div> | es5.js:4:24:4:27 | this |
|
||||
| es5.js:20:12:20:44 | <h1>Hel ... e}</h1> | es5.js:20:24:20:27 | this |
|
||||
| es6.js:3:12:3:45 | <div>He ... }</div> | es6.js:3:24:3:27 | this |
|
||||
| statePropertyWrites.js:38:12:38:45 | <div>He ... }</div> | statePropertyWrites.js:38:24:38:27 | this |
|
||||
| thisAccesses.js:60:19:60:41 | <this.n ... s.name> | thisAccesses.js:60:20:60:23 | this |
|
||||
| thisAccesses.js:61:19:61:41 | <this.t ... s.this> | thisAccesses.js:61:20:61:23 | this |
|
||||
|
||||
@@ -8,3 +8,4 @@ import ReactComponent_getADirectPropsSource
|
||||
import ReactComponent_getACandidatePropsValue
|
||||
import ReactComponent
|
||||
import ReactComponent_getAPropRead
|
||||
import ReactName
|
||||
|
||||
@@ -50,3 +50,14 @@ class C2 extends React.Component {
|
||||
this.state = y;
|
||||
}
|
||||
}
|
||||
|
||||
class C3 extends React.Component {
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
var foo = <this.name></this.name>;
|
||||
var bar = <this.this></this.this>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user