forked from CMU-313/cmu-313-f24-nodebb-f24-NodeBB
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add seperate iroh-analysis file to go through all files
- Loading branch information
1 parent
209cf2e
commit 829323f
Showing
8 changed files
with
726 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
{ | ||
"extends": "nodebb" | ||
} | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended" | ||
], | ||
"rules": { | ||
"no-undef": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import globals from "globals"; | ||
import pluginJs from "@eslint/js"; | ||
import pluginReact from "eslint-plugin-react"; | ||
|
||
|
||
export default [ | ||
{files: ["**/*.{js,mjs,cjs,jsx}"]}, | ||
{languageOptions: { globals: globals.browser }}, | ||
pluginJs.configs.recommended, | ||
pluginReact.configs.flat.recommended, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const glob = require('glob'); | ||
const Iroh = require('iroh'); | ||
|
||
let files = glob.sync(path.join(__dirname, 'src/**/*.js')); | ||
|
||
files.forEach(file => { | ||
console.log(`Analyzing file: ${file}`); | ||
}); | ||
|
||
let code = files.map(file => fs.readFileSync(file, 'utf-8')).join('\n'); | ||
|
||
// Create the Iroh stage with the combined code | ||
let stage = new Iroh.Stage(code); | ||
|
||
// Add listeners, if needed | ||
// Example listener to analyze functions: | ||
let listener = stage.addListener(Iroh.FUNCTION); | ||
listener.on("return", (e) => { | ||
console.log(`Function ${e.name} returns value:`, e.return); | ||
}); | ||
|
||
// Run the stage | ||
eval(stage.script); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
{ | ||
"analyze": { | ||
"entry": "app.js", | ||
"output": "./iroh-report", | ||
"verbose": true | ||
} | ||
} | ||
"analyze": { | ||
"entry": "simple-app.js", | ||
"output": "./iroh-report", | ||
"verbose": true, | ||
"dynamic": true, | ||
"timeout": 60000 | ||
} | ||
} |
Oops, something went wrong.