Skip to content

Instantly share code, notes, and snippets.

View TotooriaHyperion's full-sized avatar

Elaina Cherudim TotooriaHyperion

  • Bytedance Inc.
  • China Shanghai
View GitHub Profile
@TotooriaHyperion
TotooriaHyperion / get_free_vars.ts
Created August 28, 2020 07:06 — forked from buhichan/get_free_vars.ts
js get free variables hack
/**
* some insane hack, just want to avoid using expensive parser.
*/
export function getFreeVariables(expr:string, knownSymbols:Record<string,unknown>){
const freeVariables = new Set<string>();
//eslint-disable-next-line
const anyThingPrimitive = ()=>{};