mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
basic support for .cjs files
This commit is contained in:
1
javascript/extractor/tests/extensions/input/tst4.cjs
Normal file
1
javascript/extractor/tests/extensions/input/tst4.cjs
Normal file
@@ -0,0 +1 @@
|
||||
console.log("Hello CommonJS");
|
||||
141
javascript/extractor/tests/extensions/output/trap/tst4.cjs.trap
Normal file
141
javascript/extractor/tests/extensions/output/trap/tst4.cjs.trap
Normal file
@@ -0,0 +1,141 @@
|
||||
#10000=@"/tst4.cjs;sourcefile"
|
||||
files(#10000,"/tst4.cjs","tst4","cjs",0)
|
||||
#10001=@"/;folder"
|
||||
folders(#10001,"/","")
|
||||
containerparent(#10001,#10000)
|
||||
#10002=@"loc,{#10000},0,0,0,0"
|
||||
locations_default(#10002,#10000,0,0,0,0)
|
||||
hasLocation(#10000,#10002)
|
||||
#20000=@"global_scope"
|
||||
scopes(#20000,0)
|
||||
#20001=@"script;{#10000},1,1"
|
||||
#20002=*
|
||||
lines(#20002,#20001,"console.log(""Hello CommonJS"");","
|
||||
")
|
||||
#20003=@"loc,{#10000},1,1,1,30"
|
||||
locations_default(#20003,#10000,1,1,1,30)
|
||||
hasLocation(#20002,#20003)
|
||||
numlines(#20001,1,1,0)
|
||||
#20004=*
|
||||
tokeninfo(#20004,6,#20001,0,"console")
|
||||
#20005=@"loc,{#10000},1,1,1,7"
|
||||
locations_default(#20005,#10000,1,1,1,7)
|
||||
hasLocation(#20004,#20005)
|
||||
#20006=*
|
||||
tokeninfo(#20006,8,#20001,1,".")
|
||||
#20007=@"loc,{#10000},1,8,1,8"
|
||||
locations_default(#20007,#10000,1,8,1,8)
|
||||
hasLocation(#20006,#20007)
|
||||
#20008=*
|
||||
tokeninfo(#20008,6,#20001,2,"log")
|
||||
#20009=@"loc,{#10000},1,9,1,11"
|
||||
locations_default(#20009,#10000,1,9,1,11)
|
||||
hasLocation(#20008,#20009)
|
||||
#20010=*
|
||||
tokeninfo(#20010,8,#20001,3,"(")
|
||||
#20011=@"loc,{#10000},1,12,1,12"
|
||||
locations_default(#20011,#10000,1,12,1,12)
|
||||
hasLocation(#20010,#20011)
|
||||
#20012=*
|
||||
tokeninfo(#20012,4,#20001,4,"""Hello CommonJS""")
|
||||
#20013=@"loc,{#10000},1,13,1,28"
|
||||
locations_default(#20013,#10000,1,13,1,28)
|
||||
hasLocation(#20012,#20013)
|
||||
#20014=*
|
||||
tokeninfo(#20014,8,#20001,5,")")
|
||||
#20015=@"loc,{#10000},1,29,1,29"
|
||||
locations_default(#20015,#10000,1,29,1,29)
|
||||
hasLocation(#20014,#20015)
|
||||
#20016=*
|
||||
tokeninfo(#20016,8,#20001,6,";")
|
||||
#20017=@"loc,{#10000},1,30,1,30"
|
||||
locations_default(#20017,#10000,1,30,1,30)
|
||||
hasLocation(#20016,#20017)
|
||||
#20018=*
|
||||
tokeninfo(#20018,0,#20001,7,"")
|
||||
#20019=@"loc,{#10000},2,1,2,0"
|
||||
locations_default(#20019,#10000,2,1,2,0)
|
||||
hasLocation(#20018,#20019)
|
||||
toplevels(#20001,0)
|
||||
#20020=@"loc,{#10000},1,1,2,0"
|
||||
locations_default(#20020,#10000,1,1,2,0)
|
||||
hasLocation(#20001,#20020)
|
||||
#20021=@"module;{#10000},1,1"
|
||||
scopes(#20021,3)
|
||||
scopenodes(#20001,#20021)
|
||||
scopenesting(#20021,#20000)
|
||||
#20022=@"var;{require};{#20021}"
|
||||
variables(#20022,"require",#20021)
|
||||
#20023=@"var;{module};{#20021}"
|
||||
variables(#20023,"module",#20021)
|
||||
#20024=@"var;{exports};{#20021}"
|
||||
variables(#20024,"exports",#20021)
|
||||
#20025=@"var;{__filename};{#20021}"
|
||||
variables(#20025,"__filename",#20021)
|
||||
#20026=@"var;{__dirname};{#20021}"
|
||||
variables(#20026,"__dirname",#20021)
|
||||
#20027=@"var;{arguments};{#20021}"
|
||||
variables(#20027,"arguments",#20021)
|
||||
isModule(#20001)
|
||||
#20028=*
|
||||
stmts(#20028,2,#20001,0,"console ... onJS"");")
|
||||
hasLocation(#20028,#20003)
|
||||
stmtContainers(#20028,#20001)
|
||||
#20029=*
|
||||
exprs(#20029,13,#20028,0,"console ... monJS"")")
|
||||
#20030=@"loc,{#10000},1,1,1,29"
|
||||
locations_default(#20030,#10000,1,1,1,29)
|
||||
hasLocation(#20029,#20030)
|
||||
enclosingStmt(#20029,#20028)
|
||||
exprContainers(#20029,#20001)
|
||||
#20031=*
|
||||
exprs(#20031,14,#20029,-1,"console.log")
|
||||
#20032=@"loc,{#10000},1,1,1,11"
|
||||
locations_default(#20032,#10000,1,1,1,11)
|
||||
hasLocation(#20031,#20032)
|
||||
enclosingStmt(#20031,#20028)
|
||||
exprContainers(#20031,#20001)
|
||||
#20033=*
|
||||
exprs(#20033,79,#20031,0,"console")
|
||||
hasLocation(#20033,#20005)
|
||||
enclosingStmt(#20033,#20028)
|
||||
exprContainers(#20033,#20001)
|
||||
literals("console","console",#20033)
|
||||
#20034=@"var;{console};{#20000}"
|
||||
variables(#20034,"console",#20000)
|
||||
bind(#20033,#20034)
|
||||
#20035=*
|
||||
exprs(#20035,0,#20031,1,"log")
|
||||
hasLocation(#20035,#20009)
|
||||
enclosingStmt(#20035,#20028)
|
||||
exprContainers(#20035,#20001)
|
||||
literals("log","log",#20035)
|
||||
#20036=*
|
||||
exprs(#20036,4,#20029,0,"""Hello CommonJS""")
|
||||
hasLocation(#20036,#20013)
|
||||
enclosingStmt(#20036,#20028)
|
||||
exprContainers(#20036,#20001)
|
||||
literals("Hello CommonJS","""Hello CommonJS""",#20036)
|
||||
#20037=*
|
||||
regexpterm(#20037,14,#20036,0,"Hello CommonJS")
|
||||
#20038=@"loc,{#10000},1,14,1,27"
|
||||
locations_default(#20038,#10000,1,14,1,27)
|
||||
hasLocation(#20037,#20038)
|
||||
regexpConstValue(#20037,"Hello CommonJS")
|
||||
#20039=*
|
||||
entry_cfg_node(#20039,#20001)
|
||||
#20040=@"loc,{#10000},1,1,1,0"
|
||||
locations_default(#20040,#10000,1,1,1,0)
|
||||
hasLocation(#20039,#20040)
|
||||
#20041=*
|
||||
exit_cfg_node(#20041,#20001)
|
||||
hasLocation(#20041,#20019)
|
||||
successor(#20028,#20033)
|
||||
successor(#20036,#20029)
|
||||
successor(#20035,#20031)
|
||||
successor(#20033,#20035)
|
||||
successor(#20031,#20036)
|
||||
successor(#20029,#20041)
|
||||
successor(#20039,#20028)
|
||||
numlines(#10000,1,1,0)
|
||||
filetype(#10000,"javascript")
|
||||
Reference in New Issue
Block a user