├── packages ├── core │ ├── src │ │ ├── es5.js │ │ ├── v2 │ │ │ └── context.js │ │ ├── options.js │ │ ├── .babelrc │ │ └── presets │ │ │ └── defunct.js │ ├── test │ │ ├── samples │ │ │ ├── options │ │ │ │ ├── mfjscore.js │ │ │ │ ├── generators-in.js │ │ │ │ ├── meta-info.opts │ │ │ │ ├── wrap-arg-in.js │ │ │ │ ├── initial-scope-in.js │ │ │ │ ├── wrap-top.opts │ │ │ │ ├── es-block.opts │ │ │ │ ├── newtarget-in.js │ │ │ │ ├── clos-conv.opts │ │ │ │ ├── module-descr.opts │ │ │ │ ├── minimal-in.js │ │ │ │ ├── meta-info-in.js │ │ │ │ ├── wrap-arg-out-f.js │ │ │ │ ├── generators-out-ft.js │ │ │ │ ├── identity-in.js │ │ │ │ ├── newtarget-out-f.js │ │ │ │ ├── initial-scope-out-f.js │ │ │ │ ├── generators-out-f.js │ │ │ │ ├── newtarget-out-ft.js │ │ │ │ ├── props-get.opts │ │ │ │ ├── initial-scope-out-ft.js │ │ │ │ ├── minimal-out-f.js │ │ │ │ ├── clos-conv-in.js │ │ │ │ ├── wrap-arg-out-ft.js │ │ │ │ ├── minimal-out-ft.js │ │ │ │ ├── hoist-top-in.js │ │ │ │ ├── next-in.js │ │ │ │ └── eval.opts │ │ │ ├── simple │ │ │ │ ├── block │ │ │ │ │ ├── test35-out-f.js │ │ │ │ │ ├── test35-in.js │ │ │ │ │ ├── test35-out-ft.js │ │ │ │ │ ├── test49-in.js │ │ │ │ │ ├── test36-out-f.js │ │ │ │ │ ├── test36-in.js │ │ │ │ │ ├── test36-out-ft.js │ │ │ │ │ ├── test02-in.js │ │ │ │ │ ├── test32-in.js │ │ │ │ │ ├── test48-in.js │ │ │ │ │ ├── test38-out-f.js │ │ │ │ │ ├── test38-out-ft.js │ │ │ │ │ ├── test53-in.js │ │ │ │ │ ├── test57-in.js │ │ │ │ │ ├── test37-in.js │ │ │ │ │ ├── test38-in.js │ │ │ │ │ ├── test24-in.js │ │ │ │ │ ├── test43-in.js │ │ │ │ │ ├── test47-in.js │ │ │ │ │ ├── test54-in.js │ │ │ │ │ ├── test60-in.js │ │ │ │ │ ├── test17-in.js │ │ │ │ │ ├── test44-in.js │ │ │ │ │ ├── test50-in.js │ │ │ │ │ ├── test59-in.js │ │ │ │ │ ├── test34-in.js │ │ │ │ │ ├── test45-in.js │ │ │ │ │ ├── test01-in.js │ │ │ │ │ ├── test26-in.js │ │ │ │ │ ├── test18-in.js │ │ │ │ │ ├── test23-in.js │ │ │ │ │ ├── test49-out-f.js │ │ │ │ │ ├── test20-in.js │ │ │ │ │ ├── test33-in.js │ │ │ │ │ ├── test13-in.js │ │ │ │ │ ├── test15-in.js │ │ │ │ │ ├── test48-out-f.js │ │ │ │ │ ├── test02-out-f.js │ │ │ │ │ ├── test14-in.js │ │ │ │ │ ├── test03-in.js │ │ │ │ │ ├── test25-in.js │ │ │ │ │ ├── test42-in.js │ │ │ │ │ ├── test51-in.js │ │ │ │ │ ├── test52-in.js │ │ │ │ │ ├── test55-in.js │ │ │ │ │ ├── test56-in.js │ │ │ │ │ ├── test16-in.js │ │ │ │ │ ├── test21-in.js │ │ │ │ │ ├── test32-out-f.js │ │ │ │ │ ├── test62-in.js │ │ │ │ │ ├── test22-in.js │ │ │ │ │ ├── test49-out-ft.js │ │ │ │ │ ├── test61-in.js │ │ │ │ │ ├── test04-in.js │ │ │ │ │ ├── test37-out-f.js │ │ │ │ │ ├── test10-in.js │ │ │ │ │ ├── test11-in.js │ │ │ │ │ ├── test58-in.js │ │ │ │ │ ├── test53-out-f.js │ │ │ │ │ ├── test57-out-f.js │ │ │ │ │ ├── test08-in.js │ │ │ │ │ ├── test07-in.js │ │ │ │ │ ├── test09-in.js │ │ │ │ │ ├── test17-out-f.js │ │ │ │ │ ├── test30-in.js │ │ │ │ │ ├── test47-out-f.js │ │ │ │ │ ├── test54-out-f.js │ │ │ │ │ ├── test05-in.js │ │ │ │ │ ├── test06-in.js │ │ │ │ │ ├── test48-out-ft.js │ │ │ │ │ ├── test24-out-f.js │ │ │ │ │ ├── test02-out-ft.js │ │ │ │ │ ├── test32-out-ft.js │ │ │ │ │ ├── test50-out-f.js │ │ │ │ │ ├── test37-out-ft.js │ │ │ │ │ ├── test60-out-f.js │ │ │ │ │ ├── test43-out-f.js │ │ │ │ │ ├── test53-out-ft.js │ │ │ │ │ ├── test57-out-ft.js │ │ │ │ │ ├── test59-out-f.js │ │ │ │ │ ├── test15-out-f.js │ │ │ │ │ ├── test31-in.js │ │ │ │ │ ├── test47-out-ft.js │ │ │ │ │ ├── test54-out-ft.js │ │ │ │ │ ├── test16-out-f.js │ │ │ │ │ ├── test17-out-ft.js │ │ │ │ │ ├── test34-out-f.js │ │ │ │ │ ├── test50-out-ft.js │ │ │ │ │ ├── test24-out-ft.js │ │ │ │ │ ├── test43-out-ft.js │ │ │ │ │ ├── test44-out-f.js │ │ │ │ │ ├── test14-out-f.js │ │ │ │ │ ├── test13-out-f.js │ │ │ │ │ ├── test20-out-f.js │ │ │ │ │ ├── test03-out-f.js │ │ │ │ │ ├── test33-out-f.js │ │ │ │ │ ├── test60-out-ft.js │ │ │ │ │ ├── test01-out-f.js │ │ │ │ │ ├── test18-out-f.js │ │ │ │ │ ├── test26-out-f.js │ │ │ │ │ ├── test41-in.js │ │ │ │ │ └── test45-out-f.js │ │ │ │ ├── expr │ │ │ │ │ ├── test02-in.js │ │ │ │ │ ├── test01-in.js │ │ │ │ │ ├── test01-out-f.js │ │ │ │ │ ├── test01-out-ft.js │ │ │ │ │ ├── test11-in.js │ │ │ │ │ ├── test12-in.js │ │ │ │ │ ├── test05-in.js │ │ │ │ │ ├── test16-in.js │ │ │ │ │ ├── test06-in.js │ │ │ │ │ ├── test10-in.js │ │ │ │ │ ├── test13-in.js │ │ │ │ │ ├── test04-in.js │ │ │ │ │ ├── test14-in.js │ │ │ │ │ ├── test15-in.js │ │ │ │ │ ├── test03-in.js │ │ │ │ │ ├── test08-in.js │ │ │ │ │ ├── test09-in.js │ │ │ │ │ ├── test17-in.js │ │ │ │ │ ├── test07-in.js │ │ │ │ │ ├── test21-in.js │ │ │ │ │ ├── test19-in.js │ │ │ │ │ ├── test18-in.js │ │ │ │ │ ├── test02-out-f.js │ │ │ │ │ ├── test20-in.js │ │ │ │ │ ├── test06-out-f.js │ │ │ │ │ ├── test03-out-f.js │ │ │ │ │ ├── test02-out-ft.js │ │ │ │ │ ├── test05-out-f.js │ │ │ │ │ ├── test18-out-f.js │ │ │ │ │ ├── test06-out-ft.js │ │ │ │ │ ├── test04-out-f.js │ │ │ │ │ ├── test08-out-f.js │ │ │ │ │ ├── test07-out-f.js │ │ │ │ │ ├── test09-out-f.js │ │ │ │ │ ├── test03-out-ft.js │ │ │ │ │ ├── test11-out-f.js │ │ │ │ │ ├── test12-out-f.js │ │ │ │ │ ├── test10-out-f.js │ │ │ │ │ ├── test16-out-f.js │ │ │ │ │ ├── test21-out-f.js │ │ │ │ │ ├── test19-out-f.js │ │ │ │ │ ├── test05-out-ft.js │ │ │ │ │ ├── test18-out-ft.js │ │ │ │ │ ├── test20-out-f.js │ │ │ │ │ ├── test15-out-f.js │ │ │ │ │ ├── test17-out-f.js │ │ │ │ │ ├── test04-out-ft.js │ │ │ │ │ ├── test08-out-ft.js │ │ │ │ │ ├── test09-out-ft.js │ │ │ │ │ ├── test07-out-ft.js │ │ │ │ │ ├── test19-out-ft.js │ │ │ │ │ ├── test14-out-f.js │ │ │ │ │ ├── test20-out-ft.js │ │ │ │ │ ├── test15-out-ft.js │ │ │ │ │ ├── test17-out-ft.js │ │ │ │ │ ├── test11-out-ft.js │ │ │ │ │ ├── test12-out-ft.js │ │ │ │ │ ├── test10-out-ft.js │ │ │ │ │ ├── test16-out-ft.js │ │ │ │ │ └── test21-out-ft.js │ │ │ │ ├── exceptions │ │ │ │ │ ├── test01-in.js │ │ │ │ │ ├── test02-in.js │ │ │ │ │ ├── test04-in.js │ │ │ │ │ ├── test08-in.js │ │ │ │ │ ├── test07-in.js │ │ │ │ │ ├── test05-in.js │ │ │ │ │ ├── test06-in.js │ │ │ │ │ ├── test01-out-f.js │ │ │ │ │ ├── test02-out-f.js │ │ │ │ │ ├── test01-out-ft.js │ │ │ │ │ ├── test02-out-ft.js │ │ │ │ │ ├── test04-out-f.js │ │ │ │ │ ├── test04-out-ft.js │ │ │ │ │ └── test03-in.js │ │ │ │ ├── profiles │ │ │ │ │ ├── test01-in.js │ │ │ │ │ ├── test03-in.js │ │ │ │ │ ├── test02-in.js │ │ │ │ │ ├── test01-out-f.js │ │ │ │ │ ├── test02-out-f.js │ │ │ │ │ ├── test04-in.js │ │ │ │ │ ├── test01-out-ft.js │ │ │ │ │ ├── test02-out-ft.js │ │ │ │ │ ├── test03-out-f.js │ │ │ │ │ ├── test05-in.js │ │ │ │ │ └── test03-out-ft.js │ │ │ │ ├── loops │ │ │ │ │ ├── test09-in.js │ │ │ │ │ ├── test05-in.js │ │ │ │ │ ├── test04-in.js │ │ │ │ │ ├── test06-in.js │ │ │ │ │ ├── test08-in.js │ │ │ │ │ ├── test11-out-f.js │ │ │ │ │ ├── test11-out-ft.js │ │ │ │ │ ├── test11-in.js │ │ │ │ │ ├── test10-in.js │ │ │ │ │ ├── test01-in.js │ │ │ │ │ ├── test02-in.js │ │ │ │ │ ├── test03-in.js │ │ │ │ │ ├── test07-in.js │ │ │ │ │ └── test07-out-f.js │ │ │ │ └── generators │ │ │ │ │ ├── test02.opts │ │ │ │ │ └── functionSent-in.js │ │ │ ├── inject-runtime │ │ │ │ ├── with-inlining │ │ │ │ │ └── test1.opts │ │ │ │ ├── without-import │ │ │ │ │ ├── test1-in.js │ │ │ │ │ ├── with-commonjs-target │ │ │ │ │ │ ├── test1-in.js │ │ │ │ │ │ ├── test1.opts │ │ │ │ │ │ ├── test1-out-ft.js │ │ │ │ │ │ └── test1-out-f.js │ │ │ │ │ ├── with-name-conflict │ │ │ │ │ │ ├── test1-in.js │ │ │ │ │ │ ├── test1.opts │ │ │ │ │ │ ├── test1-out-ft.js │ │ │ │ │ │ └── test1-out-f.js │ │ │ │ │ ├── test1.opts │ │ │ │ │ ├── test1-out-ft.js │ │ │ │ │ └── test1-out-f.js │ │ │ │ ├── with-commonjs │ │ │ │ │ ├── with-conflict │ │ │ │ │ │ ├── test1-in.js │ │ │ │ │ │ ├── test1.opts │ │ │ │ │ │ ├── test1-out-ft.js │ │ │ │ │ │ └── test1-out-f.js │ │ │ │ │ ├── test1-in.js │ │ │ │ │ ├── with-assign │ │ │ │ │ │ ├── test1-in.js │ │ │ │ │ │ ├── test1.opts │ │ │ │ │ │ ├── test1-out-ft.js │ │ │ │ │ │ └── test1-out-f.js │ │ │ │ │ ├── test1.opts │ │ │ │ │ ├── test1-out-ft.js │ │ │ │ │ └── test1-out-f.js │ │ │ │ ├── with-detect │ │ │ │ │ ├── without-import │ │ │ │ │ │ ├── test1-in.js │ │ │ │ │ │ ├── test1-out-f.js │ │ │ │ │ │ ├── test1-out-ft.js │ │ │ │ │ │ └── test1.opts │ │ │ │ │ └── with-import │ │ │ │ │ │ ├── test1-in.js │ │ │ │ │ │ ├── test1.opts │ │ │ │ │ │ ├── test1-out-ft.js │ │ │ │ │ │ └── test1-out-f.js │ │ │ │ └── with-es6-import │ │ │ │ │ ├── test1-in.js │ │ │ │ │ ├── with-import-default │ │ │ │ │ ├── test1-in.js │ │ │ │ │ ├── test1.opts │ │ │ │ │ ├── test1-out-ft.js │ │ │ │ │ └── test1-out-f.js │ │ │ │ │ ├── test1.opts │ │ │ │ │ ├── test1-out-ft.js │ │ │ │ │ └── test1-out-f.js │ │ │ ├── if-stmt │ │ │ │ ├── all-eff-in.js │ │ │ │ ├── condition-eff-in.js │ │ │ │ ├── all-pure-out-f.js │ │ │ │ ├── all-pure-out-ft.js │ │ │ │ ├── all-pure-in.js │ │ │ │ ├── condition-eff-out-f.js │ │ │ │ ├── all-eff-out-f.js │ │ │ │ └── all-eff-out-ft.js │ │ │ ├── break-stmt │ │ │ │ ├── test3-in.js │ │ │ │ ├── test2-in.js │ │ │ │ ├── test4-in.js │ │ │ │ ├── test3-out-f.js │ │ │ │ ├── with-try-stmt │ │ │ │ │ ├── test3-in.js │ │ │ │ │ ├── test2-in.js │ │ │ │ │ ├── test2-out-f.js │ │ │ │ │ ├── test1-in.js │ │ │ │ │ ├── test4-in.js │ │ │ │ │ └── test2-out-ft.js │ │ │ │ ├── test4-out-f.js │ │ │ │ ├── test2-out-f.js │ │ │ │ ├── test3-out-ft.js │ │ │ │ ├── test4-out-ft.js │ │ │ │ └── test2-out-ft.js │ │ │ ├── others │ │ │ │ ├── require-prefix.opts │ │ │ │ ├── require-no-prefix-in.js │ │ │ │ ├── require-no-prefix-out-f.js │ │ │ │ ├── require-no-prefix-out-ft.js │ │ │ │ ├── require-prefix-in.js │ │ │ │ ├── require-prefix-out-f.js │ │ │ │ └── require-prefix-out-ft.js │ │ │ ├── .babelrc │ │ │ ├── do-while-stmt │ │ │ │ └── body-eff │ │ │ │ │ ├── test1-in.js │ │ │ │ │ └── it-has-break-stmt │ │ │ │ │ └── test1-in.js │ │ │ ├── par │ │ │ │ └── seq-bind-in.js │ │ │ ├── try-stmt │ │ │ │ ├── finally-section │ │ │ │ │ └── test1-in.js │ │ │ │ └── opt-catch-bind-in.js │ │ │ ├── for-stmt │ │ │ │ ├── body-eff │ │ │ │ │ ├── test1-in.js │ │ │ │ │ ├── test2-in.js │ │ │ │ │ └── test1-out-f.js │ │ │ │ ├── last │ │ │ │ │ ├── test1-in.js │ │ │ │ │ ├── it-has-break-stmt │ │ │ │ │ │ └── with-label-in.js │ │ │ │ │ └── test1-out-f.js │ │ │ │ ├── it-has-break-stmt │ │ │ │ │ ├── test1-in.js │ │ │ │ │ └── with-label │ │ │ │ │ │ └── test1-in.js │ │ │ │ └── it-has-continue-stmt │ │ │ │ │ └── test1-in.js │ │ │ ├── switch-stmt │ │ │ │ ├── test4-in.js │ │ │ │ ├── test6-in.js │ │ │ │ ├── test3-in.js │ │ │ │ ├── test2-in.js │ │ │ │ ├── test5-in.js │ │ │ │ ├── test10-in.js │ │ │ │ ├── test9-in.js │ │ │ │ ├── test8-in.js │ │ │ │ ├── test6-out-f.js │ │ │ │ └── test3-out-f.js │ │ │ ├── operations │ │ │ │ └── block-stmt-in.js │ │ │ └── placeholder │ │ │ │ └── with-arg-in.js │ │ ├── kit │ │ │ ├── inject.js │ │ │ └── generate-sm.js │ │ ├── samples.js │ │ └── .babelrc │ ├── .npmignore │ ├── babel │ │ ├── ts-preproc.js │ │ ├── ts-no-consts.js │ │ └── preset-react.js │ └── README.md ├── es-inline │ ├── .babelrc │ ├── macro.js │ ├── preset.js │ ├── transform.js │ ├── test │ │ ├── kit │ │ │ └── makeLinks.js │ │ ├── right │ │ │ └── .babelrc │ │ ├── default │ │ │ └── .babelrc │ │ ├── loose │ │ │ └── .babelrc │ │ ├── generators.js │ │ └── async.js │ ├── .npmignore │ ├── options.js │ └── README.md ├── core-loose │ ├── test │ │ ├── samples │ │ │ ├── par │ │ │ │ └── SKIP │ │ │ ├── others │ │ │ │ └── SKIP │ │ │ ├── scope │ │ │ │ └── with-temp-vars │ │ │ │ │ └── SKIP │ │ │ ├── options │ │ │ │ ├── meta-info.opts │ │ │ │ ├── wrap-top.opts │ │ │ │ ├── es-block.opts │ │ │ │ ├── clos-conv.opts │ │ │ │ ├── module-descr.opts │ │ │ │ ├── props-get.opts │ │ │ │ └── eval.opts │ │ │ ├── simple │ │ │ │ └── generators │ │ │ │ │ └── test02.opts │ │ │ └── inject-runtime │ │ │ │ ├── with-es6-import │ │ │ │ ├── test1.opts │ │ │ │ └── with-import-default │ │ │ │ │ └── test1.opts │ │ │ │ ├── without-import │ │ │ │ ├── test1.opts │ │ │ │ ├── with-name-conflict │ │ │ │ │ └── test1.opts │ │ │ │ └── with-commonjs-target │ │ │ │ │ └── test1.opts │ │ │ │ └── with-commonjs │ │ │ │ ├── test1.opts │ │ │ │ ├── with-conflict │ │ │ │ └── test1.opts │ │ │ │ └── with-assign │ │ │ │ └── test1.opts │ │ └── .babelrc │ ├── README.md │ └── .npmignore ├── es-persist │ ├── main.d.ts │ ├── index.d.ts │ ├── macro.js │ ├── test │ │ ├── kit │ │ │ └── inject.js │ │ └── .babelrc │ ├── api │ │ └── README.md │ ├── tsconfig.json │ ├── rollup.config.mjs │ ├── .npmignore │ └── transform.js ├── debugger │ ├── test │ │ ├── __fixtures__ │ │ │ ├── stepOutCJS3.js │ │ │ ├── stepOverCJS3.js │ │ │ ├── tt │ │ │ │ ├── stepBackCJS3.js │ │ │ │ ├── reverseContinueCJS3.js │ │ │ │ ├── stepBackESM3.js │ │ │ │ ├── reverseContinueESM3.js │ │ │ │ ├── stepBackCJS.js │ │ │ │ ├── stepBackCJS2.js │ │ │ │ ├── reverseContinueCJS.js │ │ │ │ ├── watchExpr.js │ │ │ │ ├── stepBackESM.js │ │ │ │ ├── reverseContinueCJS2.js │ │ │ │ ├── reverseContinueESM.js │ │ │ │ ├── stepBackESM2.js │ │ │ │ ├── reverseContinueESM2.js │ │ │ │ ├── breakpoints.js │ │ │ │ ├── funconstr.js │ │ │ │ ├── setTimeout.js │ │ │ │ ├── stepBackPlain.js │ │ │ │ ├── reverseContinuePlain.js │ │ │ │ ├── evalDir.js │ │ │ │ ├── evalIndir.js │ │ │ │ ├── stepBackGenerator.js │ │ │ │ └── reverseContinueGenerator.js │ │ │ ├── breakpointSubMod.js │ │ │ ├── stepOutESM3.js │ │ │ ├── stepOverESM3.js │ │ │ ├── stepInCJS.js │ │ │ ├── stepInCJS2.js │ │ │ ├── stepInCJS3.js │ │ │ ├── stepOutCJS.js │ │ │ ├── stepOutCJS2.js │ │ │ ├── conditionalBreakpoints.js │ │ │ ├── stepOverCJS.js │ │ │ ├── stepOverCJS2.js │ │ │ ├── hitCond.js │ │ │ ├── logPoints.js │ │ │ ├── watchExpr.js │ │ │ ├── stepOverESM.js │ │ │ ├── exceptionBreakpointsUncaught.js │ │ │ ├── stepInESM2.js │ │ │ ├── pause.js │ │ │ ├── stepInESM3.js │ │ │ ├── stepOutESM.js │ │ │ ├── stepOutESM2.js │ │ │ ├── stepOverESM2.js │ │ │ ├── stepInESM.js │ │ │ ├── columns.js │ │ │ ├── breakpoints.js │ │ │ ├── exceptionBreakpoints.js │ │ │ ├── mod.js │ │ │ ├── funconstr.js │ │ │ ├── mod1.js │ │ │ ├── setImmediate.js │ │ │ ├── transform │ │ │ │ └── mod1.js │ │ │ ├── stepInPlain.js │ │ │ ├── asyncSteps.js │ │ │ ├── stepOverPlain.js │ │ │ ├── generatorStep.js │ │ │ ├── evalDir.js │ │ │ ├── evalIndir.js │ │ │ ├── stepInGenerator.js │ │ │ ├── stepOutGenerator.js │ │ │ ├── stepOutPlain.js │ │ │ └── eval.js │ │ ├── makeLinks.js │ │ ├── setup-time-travel.js │ │ ├── setup.js │ │ ├── regenerator.test.js │ │ ├── regenerator-debug.test.js │ │ ├── regenerator-time-travel.test.js │ │ └── modules.test.js │ ├── preset.js │ ├── preset-react.js │ ├── src │ │ ├── transform.d.ts │ │ ├── vscode │ │ │ └── main.ts │ │ ├── timeTravel │ │ │ └── setup.ts │ │ ├── .babelrc │ │ └── kit.ts │ ├── api │ │ ├── modules │ │ │ ├── _config_.md │ │ │ └── _timetravel_setup_.md │ │ └── interfaces │ │ │ └── _state_.scopeinfo.md │ ├── deps-index-template.js │ ├── instr │ │ └── dom.d.ts │ ├── config │ │ ├── babel │ │ │ ├── ts-preproc.js │ │ │ └── ts-no-consts.js │ │ ├── targetResolve.js │ │ └── node │ │ │ └── reloadWorker.js │ └── .npmignore ├── js │ ├── macro.d.ts │ ├── macro.js │ ├── babel-preset.js │ ├── babel-ts-preset.js │ ├── .npmignore │ ├── babel-preset-zero-config.js │ └── babel-plugin-transform.js ├── es │ ├── macro.js │ ├── test │ │ ├── kit │ │ │ ├── inject.js │ │ │ └── makeLinks.js │ │ ├── samples │ │ │ ├── .babelrc │ │ │ └── src │ │ │ │ └── lib │ │ │ │ └── util.js │ │ ├── generators.js │ │ ├── default │ │ │ └── .babelrc │ │ └── topLevel │ │ │ └── .babelrc │ ├── preset.js │ ├── transform.js │ ├── babel.cjs.json │ ├── babel.test.json │ ├── .npmignore │ └── .env-cmdrc ├── vscode-debugger │ ├── testdata │ │ ├── vscode-node-debug │ │ │ ├── glob │ │ │ │ ├── f1 │ │ │ │ │ ├── file11.js │ │ │ │ │ └── file12.js │ │ │ │ ├── f2 │ │ │ │ │ ├── file21.js │ │ │ │ │ └── file22.js │ │ │ │ └── f3 │ │ │ │ │ ├── file31.js │ │ │ │ │ └── file32.js │ │ │ ├── programWithDebugger1.js │ │ │ ├── README.md │ │ │ ├── programWithDebuggerEval.js │ │ │ ├── programSingleLine.js │ │ │ ├── sourcemaps-entrypoint │ │ │ │ └── index.ts │ │ │ ├── programWithOutput.js │ │ │ ├── programWithDebugger.js │ │ │ ├── programWithException.js │ │ │ ├── programWithFunction.js │ │ │ ├── program.js │ │ │ └── folder with spaces │ │ │ │ └── file with spaces.js │ │ ├── restart2.js │ │ ├── hot1.js │ │ ├── hot2.js │ │ ├── child_process2.js │ │ ├── restart-entry.js │ │ ├── stepsModule.js │ │ ├── stepsModule3.js │ │ ├── stepsModule2.js │ │ ├── eval.js │ │ ├── indirect eval.js │ │ ├── child_process1.js │ │ ├── stepsTest.js │ │ ├── funconstr.js │ │ ├── function constructor.js │ │ ├── extensionTest.js │ │ ├── evalCond.js │ │ ├── restart-custom.js │ │ ├── setTimeout.js │ │ └── spawn.js │ ├── .npmignore │ ├── icon.png │ ├── src │ │ └── debugAdapter.ts │ ├── .vscode-test.mjs │ ├── .vscode │ │ └── extensions.json │ ├── .vscodeignore │ ├── tslint.json │ └── tsconfig.json ├── es-rt │ ├── .env │ ├── test │ │ ├── kit │ │ │ └── inject.js │ │ └── iterators.js │ ├── .npmignore │ └── src │ │ └── .babelrc ├── serialization-react │ ├── test │ │ ├── kit │ │ │ └── inject.js │ │ └── .babelrc │ └── .npmignore ├── cc │ ├── src │ │ └── test │ │ │ └── .babel-plugin-macrosrc.json │ └── .npmignore ├── transducers │ ├── test │ │ ├── .babelrc │ │ └── kit │ │ │ └── inject.js │ ├── .npmignore │ └── src │ │ ├── v2 │ │ └── config.js │ │ └── .babelrc ├── transducers-loose │ ├── test │ │ ├── .babelrc │ │ └── kit │ │ │ └── inject.js │ ├── .npmignore │ └── README.md ├── serialization │ ├── test │ │ └── .babelrc │ ├── api │ │ ├── README.md │ │ └── interfaces │ │ │ └── _main_.jsonobject.md │ ├── .npmignore │ └── tsconfig.json └── es-persist-serialization │ ├── transform.js │ ├── test │ └── .babelrc │ ├── .npmignore │ └── rollup.config.js ├── samples ├── react-do │ ├── options.js │ ├── macro.js │ ├── development.macro.js │ ├── .babelrc │ ├── .npmignore │ └── jest.setup.js ├── persist-counters │ ├── README.md │ ├── public │ │ └── index.html │ ├── jest.setup.js │ └── webpack.config.js └── persist-boxes │ ├── main.js │ ├── webpack.config.js │ └── README.md ├── .github └── FUNDING.yml ├── .yarnrc.yml ├── lerna.json ├── .editorconfig └── .gitmodules /packages/core/src/es5.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/react-do/options.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/es-inline/.babelrc: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [javactrl] 2 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/par/SKIP: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/others/SKIP: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/scope/with-temp-vars/SKIP: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/es-persist/main.d.ts: -------------------------------------------------------------------------------- 1 | export * from "./types"; 2 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOutCJS3.js: -------------------------------------------------------------------------------- 1 | debugger; -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOverCJS3.js: -------------------------------------------------------------------------------- 1 | debugger; -------------------------------------------------------------------------------- /packages/es-persist/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from "./types"; 2 | -------------------------------------------------------------------------------- /packages/js/macro.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export default function(): void; 3 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/mfjscore.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/stepBackCJS3.js: -------------------------------------------------------------------------------- 1 | console.log("CJS3") -------------------------------------------------------------------------------- /packages/es/macro.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./transform").macro(); 2 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/glob/f1/file11.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/glob/f1/file12.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/glob/f2/file21.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/glob/f2/file22.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/glob/f3/file31.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/glob/f3/file32.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/reverseContinueCJS3.js: -------------------------------------------------------------------------------- 1 | debugger 2 | -------------------------------------------------------------------------------- /packages/es-rt/.env: -------------------------------------------------------------------------------- 1 | BABEL_ENV=configure 2 | EJS_LEAN_METHOD_ITERATORS=1 3 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/restart2.js: -------------------------------------------------------------------------------- 1 | console.log("NEW SOURCES"); 2 | -------------------------------------------------------------------------------- /samples/react-do/macro.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./transform").macro(); 2 | -------------------------------------------------------------------------------- /packages/debugger/preset.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./scripts/babel/preset"); 2 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/breakpointSubMod.js: -------------------------------------------------------------------------------- 1 | let j = 0; 2 | j++; 3 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/stepBackESM3.js: -------------------------------------------------------------------------------- 1 | export default "hi"; 2 | -------------------------------------------------------------------------------- /packages/es-inline/macro.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./transform").macro(); 2 | -------------------------------------------------------------------------------- /packages/es-persist/macro.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./transform").macro(); 2 | -------------------------------------------------------------------------------- /packages/serialization-react/test/kit/inject.js: -------------------------------------------------------------------------------- 1 | require("@babel/register"); 2 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test35-out-f.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | 1 + 1; 3 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test35-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | 1 + 1; 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test35-out-ft.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | 1 + 1; 3 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test49-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(1); 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test02-in.js: -------------------------------------------------------------------------------- 1 | function M() { 2 | eff(2); 3 | } 4 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOutESM3.js: -------------------------------------------------------------------------------- 1 | debugger; 2 | export default "hi"; 3 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOverESM3.js: -------------------------------------------------------------------------------- 1 | debugger; 2 | export default "hi"; 3 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/programWithDebugger1.js: -------------------------------------------------------------------------------- 1 | debugger; 2 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test36-out-f.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (true) 1 + 1; 3 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test01-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | return 2 + 2; 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test01-out-f.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | return 2 + 2; 3 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test01-out-ft.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | return 2 + 2; 3 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test11-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(1)(eff(2)); 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test12-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(1)(eff(2)); 3 | } 4 | -------------------------------------------------------------------------------- /packages/debugger/preset-react.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./scripts/babel/preset-react"); 2 | -------------------------------------------------------------------------------- /packages/debugger/src/transform.d.ts: -------------------------------------------------------------------------------- 1 | export declare function run(ast: any, opts: object): any; 2 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/hot1.js: -------------------------------------------------------------------------------- 1 | for(const i of [1,2]) 2 | console.log(`M:${i}`) 3 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/hot2.js: -------------------------------------------------------------------------------- 1 | for(const i of [1,2]) 2 | console.log(`N:${i}`) 3 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test36-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (true) 1 + 1; 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test36-out-ft.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (true) 1 + 1; 3 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test01-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | throw eff(1); 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test05-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(effb(2)) + 2; 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test16-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(1)(eff(2) + 2); 3 | } 4 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/reverseContinueESM3.js: -------------------------------------------------------------------------------- 1 | export default "hi"; 2 | debugger; 3 | -------------------------------------------------------------------------------- /packages/es/test/kit/inject.js: -------------------------------------------------------------------------------- 1 | require("@babel/register"); 2 | global.assert = require("assert"); 3 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/child_process2.js: -------------------------------------------------------------------------------- 1 | setTimeout(() => console.log("EXIT CP2"), 100); 2 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/restart-entry.js: -------------------------------------------------------------------------------- 1 | console.log("BEFORE"); 2 | console.log("AFTER"); 3 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test02-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i; 3 | eff1(i++); 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test32-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(1); 3 | eff(2); 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test48-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff(1); 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test06-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | console.log(eff(1), 2); 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test10-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | effC(eff(1), eff(2)); 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test13-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(1)(eff(2)(eff(3))); 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/profiles/test01-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(1); 3 | eff(2); 4 | } 5 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepInCJS.js: -------------------------------------------------------------------------------- 1 | require("./stepInCJS2") 2 | require("./stepInCJS2") 3 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepInCJS2.js: -------------------------------------------------------------------------------- 1 | require("./stepInCJS3") 2 | require("./stepInCJS3") 3 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepInCJS3.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | console.log("IN A"); 3 | } 4 | a(); -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOutCJS.js: -------------------------------------------------------------------------------- 1 | require("./stepOutCJS2") 2 | require("./stepOutCJS2") 3 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOutCJS2.js: -------------------------------------------------------------------------------- 1 | require("./stepOutCJS3") 2 | require("./stepOutCJS3") 3 | -------------------------------------------------------------------------------- /packages/es/preset.js: -------------------------------------------------------------------------------- 1 | module.exports = require("@effectful/core").babelPreset(require("./options")); 2 | -------------------------------------------------------------------------------- /packages/es/test/kit/makeLinks.js: -------------------------------------------------------------------------------- 1 | var dirs = ["default", "topLevel"].forEach(require("./links").target); 2 | -------------------------------------------------------------------------------- /packages/es/transform.js: -------------------------------------------------------------------------------- 1 | module.exports = require("@effectful/core").babelPlugin(require("./options")); 2 | -------------------------------------------------------------------------------- /packages/vscode-debugger/.npmignore: -------------------------------------------------------------------------------- 1 | log 2 | .DS_Store 3 | src 4 | testdata 5 | .vscode-test 6 | *.vsix 7 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/stepsModule.js: -------------------------------------------------------------------------------- 1 | require("./stepsModule2") 2 | require("./stepsModule2") 3 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/stepsModule3.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | console.log("IN A"); 3 | } 4 | a(); -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test04-in.js: -------------------------------------------------------------------------------- 1 | function e() { 2 | console.log(eff(1) + eff(2)); 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test14-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(1)(eff(2), eff(3), 4); 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test15-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | 5 + eff(effb(2)) + effc(3); 3 | } 4 | -------------------------------------------------------------------------------- /packages/debugger/src/vscode/main.ts: -------------------------------------------------------------------------------- 1 | export { capture, restore, restart, cont, event } from "./handlers"; 2 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/conditionalBreakpoints.js: -------------------------------------------------------------------------------- 1 | let i = 0; 2 | for(;i<6;) { 3 | i++; 4 | } 5 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOverCJS.js: -------------------------------------------------------------------------------- 1 | require("./stepOverCJS2") 2 | require("./stepOverCJS2") 3 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOverCJS2.js: -------------------------------------------------------------------------------- 1 | require("./stepOverCJS3") 2 | require("./stepOverCJS3") 3 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/stepBackCJS.js: -------------------------------------------------------------------------------- 1 | require("./stepBackCJS2") 2 | require("./stepBackCJS2") 3 | -------------------------------------------------------------------------------- /packages/es-inline/preset.js: -------------------------------------------------------------------------------- 1 | module.exports = require("@effectful/core").babelPreset(require("./options")); 2 | -------------------------------------------------------------------------------- /packages/es-persist/test/kit/inject.js: -------------------------------------------------------------------------------- 1 | require("@babel/register"); 2 | global.assert = require("assert"); 3 | -------------------------------------------------------------------------------- /packages/js/macro.js: -------------------------------------------------------------------------------- 1 | const plugin = require("./babel-plugin-transform"); 2 | module.exports = plugin.macro(); 3 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/stepsModule2.js: -------------------------------------------------------------------------------- 1 | require("./stepsModule3") 2 | require("./stepsModule3") 3 | -------------------------------------------------------------------------------- /packages/cc/src/test/.babel-plugin-macrosrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "effectful": { 3 | "blackbox": false 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test38-out-f.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (true) return 2; 3 | return 3; 4 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test38-out-ft.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (true) return 2; 3 | return 3; 4 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test53-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff1(eff2(2)); 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test57-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff1(eff2(2)); 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test02-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | throw eff(1); 3 | eff(2); 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test03-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | 1 + console.log(2 + eff(3)) + 4; 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test08-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | console.log(eff(1), eff(2), 2); 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test09-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | console.log(eff(1) + eff(2), 2); 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test17-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | 5 + effc(3) + eff(effb(2) + 4); 3 | } 4 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/stepBackCJS2.js: -------------------------------------------------------------------------------- 1 | require("./stepBackCJS3") 2 | require("./stepBackCJS3") 3 | -------------------------------------------------------------------------------- /packages/es-inline/transform.js: -------------------------------------------------------------------------------- 1 | module.exports = require("@effectful/core").babelPlugin(require("./options")); 2 | -------------------------------------------------------------------------------- /packages/vscode-debugger/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awto/effectfuljs/HEAD/packages/vscode-debugger/icon.png -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test37-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (true) 1 + 1; 3 | return M.pure(); 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test38-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (true) return 2; 3 | return 3; 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test07-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | console.log(eff(1), 2) + eff(2) * 2; 3 | } 4 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/hitCond.js: -------------------------------------------------------------------------------- 1 | let i = 0, HIT_AT = 5; 2 | for(; i < 5;) 3 | i++; 4 | console.log(i); 5 | -------------------------------------------------------------------------------- /packages/serialization-react/test/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@babel/plugin-transform-react-jsx"] 3 | } 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-inlining/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "importRT": "@effectful/core" 3 | } 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/test1-in.js: -------------------------------------------------------------------------------- 1 | function* a() { 2 | yield 1; 3 | yield 2; 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test24-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i; 3 | eff1(i++); 4 | eff2(i++); 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test43-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff1(); 3 | if (a) return 5; 4 | eff6(); 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test21-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(1); 3 | this.eff(2); 4 | eff3(this); 5 | } 6 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/logPoints.js: -------------------------------------------------------------------------------- 1 | let i = 1, j = 2; 2 | for(; i < 5; i++) 3 | j*=i; 4 | console.log(j); 5 | -------------------------------------------------------------------------------- /packages/vscode-debugger/src/debugAdapter.ts: -------------------------------------------------------------------------------- 1 | import { DebugSession } from "./session"; 2 | DebugSession.run(DebugSession); 3 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/eval.js: -------------------------------------------------------------------------------- 1 | eval(`console.log("L1"); 2 | console.log("L2"); 3 | console.log("L3"); 4 | `); 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/if-stmt/all-eff-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (eff(1)) return eff(2); 3 | else return eff(3); 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test47-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff(1); 4 | i++; 5 | eff(2); 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test54-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff(1); 4 | i++; 5 | eff(2); 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test60-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = read1(); 3 | eff(i); 4 | write(i); 5 | } 6 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/watchExpr.js: -------------------------------------------------------------------------------- 1 | let i = 1; 2 | let j = 2; 3 | i+=2; 4 | j+=3; 5 | j = i * j; 6 | console.log(j); 7 | -------------------------------------------------------------------------------- /packages/transducers/test/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [["@babel/plugin-transform-modules-commonjs", {"loose":true}]] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/README.md: -------------------------------------------------------------------------------- 1 | Copied from https://github.com/microsoft/vscode-node-debug.git 2 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/lerna/schemas/lerna-schema.json", 3 | "version": "2.0.8", 4 | "npmClient": "yarn" 5 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/with-conflict/test1-in.js: -------------------------------------------------------------------------------- 1 | function* M() { 2 | yield 1; 3 | yield 2; 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-detect/without-import/test1-in.js: -------------------------------------------------------------------------------- 1 | function* a() { 2 | yield 1; 3 | yield 2; 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-detect/without-import/test1-out-f.js: -------------------------------------------------------------------------------- 1 | function* a() { 2 | yield 1; 3 | yield 2; 4 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-detect/without-import/test1-out-ft.js: -------------------------------------------------------------------------------- 1 | function* a() { 2 | yield 1; 3 | yield 2; 4 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test17-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff1(i); 4 | i++; 5 | eff2(i); 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test44-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff1(); 3 | if (a) return eff5(5); 4 | eff6(); 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test50-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (test(1)) { 3 | eff(3); 4 | } else eff(5); 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/profiles/test03-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | p1(); 3 | p2(); 4 | M(e1()); 5 | M(e(2)); 6 | } 7 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/reverseContinueCJS.js: -------------------------------------------------------------------------------- 1 | require("./reverseContinueCJS2") 2 | require("./reverseContinueCJS2") 3 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/watchExpr.js: -------------------------------------------------------------------------------- 1 | let i = 1; 2 | let j = 2; 3 | i+=2; 4 | j+=3; 5 | j = i * j; 6 | console.log(j); 7 | -------------------------------------------------------------------------------- /packages/transducers-loose/test/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [["@babel/plugin-transform-modules-commonjs", {"loose":true}]] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/indirect eval.js: -------------------------------------------------------------------------------- 1 | (0, eval)(`console.log("L1"); 2 | console.log("L2"); 3 | console.log("L3"); 4 | `); 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test59-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | i = read1(); 4 | eff(i); 5 | write(i); 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/profiles/test02-in.js: -------------------------------------------------------------------------------- 1 | function e() { 2 | M.option({ coerce: true }); 3 | eff1(); 4 | eff2(); 5 | } 6 | -------------------------------------------------------------------------------- /packages/debugger/src/timeTravel/setup.ts: -------------------------------------------------------------------------------- 1 | import config from "../config"; 2 | config.timeTravel = true; 3 | config.mutationObserver = true; 4 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOverESM.js: -------------------------------------------------------------------------------- 1 | import * as C1 from "./stepOverESM2"; 2 | import * as C2 from "./stepOverESM2"; 3 | 4 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/stepBackESM.js: -------------------------------------------------------------------------------- 1 | import * as C1 from "./stepBackESM2"; 2 | import * as C2 from "./stepBackESM2"; 3 | 4 | -------------------------------------------------------------------------------- /packages/debugger/test/makeLinks.js: -------------------------------------------------------------------------------- 1 | const { target } = require("../../es/test/kit/links"); 2 | target("es"); 3 | target("es-time-travel"); 4 | -------------------------------------------------------------------------------- /packages/debugger/test/setup-time-travel.js: -------------------------------------------------------------------------------- 1 | const config = require("./setup"); 2 | config.timeTravel = true; 3 | module.exports = config; 4 | -------------------------------------------------------------------------------- /packages/serialization/test/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "@babel/syntax-bigint", 4 | "@babel/transform-classes" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/test3-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | lab: { 3 | eff(2); 4 | break lab; 5 | } 6 | eff(4); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/with-commonjs-target/test1-in.js: -------------------------------------------------------------------------------- 1 | function* a() { 2 | yield 1; 3 | yield 2; 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test19-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | console.log(eff("1"), eff(2), 3); 3 | return console.log("4"); 4 | } 5 | -------------------------------------------------------------------------------- /packages/debugger/api/modules/_config_.md: -------------------------------------------------------------------------------- 1 | [@effectful/debugger](../README.md) › ["config"](_config_.md) 2 | 3 | # Module: "config" 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/exceptionBreakpointsUncaught.js: -------------------------------------------------------------------------------- 1 | try { 2 | throw new Error("error"); 3 | } catch (e) { 4 | throw e; 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/others/require-prefix.opts: -------------------------------------------------------------------------------- 1 | { 2 | "loaderPrefix": "@effectful/debugger/loader!", 3 | "loaderPostfix": ".edbg" 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test34-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(1); 3 | if (eff(2)) { 4 | eff3(); 5 | eff4(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test45-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff5(i++); 4 | if (ee) eff7(i++); 5 | eff8(i); 6 | } 7 | -------------------------------------------------------------------------------- /packages/debugger/deps-index-template.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Promise: require("./promise/lib"), 3 | CoreJS: require("./core-js").corejs 4 | }; 5 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepInESM2.js: -------------------------------------------------------------------------------- 1 | import * as D1 from "./stepInESM3"; 2 | import * as D2 from "./stepInESM3"; 3 | export { D1, D2 } 4 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/reverseContinueCJS2.js: -------------------------------------------------------------------------------- 1 | require("./reverseContinueCJS3") 2 | debugger; 3 | require("./reverseContinueCJS3") 4 | -------------------------------------------------------------------------------- /packages/js/babel-preset.js: -------------------------------------------------------------------------------- 1 | module.exports = require("@effectful/debugger/config/babel/preset").rebind(require.resolve("./babel-plugin-transform")); 2 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/programWithDebuggerEval.js: -------------------------------------------------------------------------------- 1 | 2 | eval('console.log("line1");\ndebugger;console.log("line3");'); 3 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/generators-in.js: -------------------------------------------------------------------------------- 1 | // *- DEFAULT 2 | import * as G from "@effectful/es"; 3 | 4 | function* c() { 5 | yield* z; 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/meta-info.opts: -------------------------------------------------------------------------------- 1 | { 2 | "injectFuncMeta": "meta", 3 | "wrapFunction": "wrap", 4 | "metaParentClosure": true 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/wrap-arg-in.js: -------------------------------------------------------------------------------- 1 | M.option({ wrapArguments: "args" }); 2 | 3 | function z2() { 4 | eff(1); 5 | aff(arguments); 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test01-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var j = 0; 3 | eff(j); 4 | eff(j++); 5 | eff2(j); 6 | eff3(j++); 7 | } 8 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/pause.js: -------------------------------------------------------------------------------- 1 | async function main() { 2 | for(;;) { 3 | await new Promise(setImmediate); 4 | } 5 | } 6 | main(); 7 | -------------------------------------------------------------------------------- /packages/es-inline/test/kit/makeLinks.js: -------------------------------------------------------------------------------- 1 | var dirs = ["default", "right", "loose"].forEach( 2 | require("@effectful/es/test/kit/links").target 3 | ); 4 | -------------------------------------------------------------------------------- /packages/es-rt/test/kit/inject.js: -------------------------------------------------------------------------------- 1 | require("@babel/register"); 2 | global.Kit = require("../../../es/test/kit"); 3 | global.assert = require("assert"); 4 | -------------------------------------------------------------------------------- /packages/es/babel.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [["@babel/plugin-transform-modules-commonjs", 3 | {"loose":true,"noInterop":true}]] 4 | } 5 | -------------------------------------------------------------------------------- /packages/js/babel-ts-preset.js: -------------------------------------------------------------------------------- 1 | module.exports = require("@effectful/debugger/config/babel/ts-preset").rebind(require.resolve("./babel-plugin-transform")); 2 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/options/meta-info.opts: -------------------------------------------------------------------------------- 1 | { 2 | "injectFuncMeta": "meta", 3 | "wrapFunction": "wrap", 4 | "metaParentClosure": true 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/with-name-conflict/test1-in.js: -------------------------------------------------------------------------------- 1 | var M = 10; 2 | function* a() { 3 | yield 1; 4 | yield 2; 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/initial-scope-in.js: -------------------------------------------------------------------------------- 1 | M.option({ scopePrefix: "otherScope" }); 2 | 3 | function scope() { 4 | eff_1(); 5 | eff_2(); 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test26-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i; 3 | i = eff1(i++); 4 | eff2(i); 5 | i = eff3(i++); 6 | eff4(i); 7 | } 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test04-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | try { 3 | eff(1); 4 | } catch (e) { 5 | console.log(e); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test18-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | console.log(eff("1"), 3); 3 | console.log("2"); 4 | return console.log("3"); 5 | } 6 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepInESM3.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | console.log("IN A"); 3 | } 4 | 5 | a(); 6 | export default { 7 | hi: "there" 8 | }; 9 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOutESM.js: -------------------------------------------------------------------------------- 1 | import * as C1 from "./stepOutESM2"; 2 | import * as C2 from "./stepOutESM2"; 3 | console.log(C1, C2); 4 | 5 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOutESM2.js: -------------------------------------------------------------------------------- 1 | import * as D1 from "./stepOutESM3"; 2 | import * as D2 from "./stepOutESM3"; 3 | 4 | export {D1,D2}; 5 | 6 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/reverseContinueESM.js: -------------------------------------------------------------------------------- 1 | import * as C1 from "./reverseContinueESM2"; 2 | import * as C2 from "./reverseContinueESM2"; 3 | 4 | -------------------------------------------------------------------------------- /packages/transducers-loose/.npmignore: -------------------------------------------------------------------------------- 1 | .git 2 | tmp-* 3 | *.orig 4 | *.log 5 | *~ 6 | *.map 7 | .DS_Store 8 | .tern-port 9 | node_modules 10 | test 11 | -------------------------------------------------------------------------------- /packages/transducers/.npmignore: -------------------------------------------------------------------------------- 1 | .git 2 | tmp-* 3 | *.orig 4 | *.log 5 | *~ 6 | *.map 7 | .DS_Store 8 | .tern-port 9 | node_modules 10 | src 11 | test 12 | -------------------------------------------------------------------------------- /packages/core/test/kit/inject.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | if (typeof EDBG === "undefined") 3 | require("@babel/register")({ ignore: ["@effectful/**/*"] }); 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@babel/plugin-syntax-async-generators", 3 | "@babel/plugin-syntax-function-sent"] 4 | } 5 | 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/do-while-stmt/body-eff/test1-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | do { 3 | if (eff(2)) continue; 4 | eff(3); 5 | } while (eff(1)); 6 | }); 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test08-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | try { 3 | eff(1); 4 | } finally { 5 | console.log("fin"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOverESM2.js: -------------------------------------------------------------------------------- 1 | import * as D1 from "./stepOverESM3"; 2 | import * as D2 from "./stepOverESM3"; 3 | 4 | export { D1, D2} 5 | 6 | -------------------------------------------------------------------------------- /packages/js/.npmignore: -------------------------------------------------------------------------------- 1 | .git 2 | tmp-* 3 | *.orig 4 | *.log 5 | *~ 6 | *.map 7 | .DS_Store 8 | .tern-port 9 | node_modules 10 | src 11 | test 12 | packages 13 | -------------------------------------------------------------------------------- /packages/core-loose/README.md: -------------------------------------------------------------------------------- 1 | # @effectful/js-loose 2 | 3 | Pre-built version of 4 | [@effectful/js](https://github.com/awto/effectfuljs/tree/master/packages/js). 5 | 6 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepInESM.js: -------------------------------------------------------------------------------- 1 | import * as C1 from "./stepInESM2"; 2 | import * as C2 from "./stepInESM2"; 3 | console.log(JSON.stringify({ C1, C2 })); 4 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/stepBackESM2.js: -------------------------------------------------------------------------------- 1 | import * as D1 from "./stepBackESM3"; 2 | import * as D2 from "./stepBackESM3"; 3 | 4 | export { D1, D2} 5 | 6 | -------------------------------------------------------------------------------- /samples/react-do/development.macro.js: -------------------------------------------------------------------------------- 1 | /** macro for running tests */ 2 | module.exports = require("./transform") 3 | .options({ importRT: "./main" }) 4 | .macro(); 5 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/test1-in.js: -------------------------------------------------------------------------------- 1 | var Z = require("@effectful/generators"); 2 | 3 | function* a() { 4 | yield 1; 5 | yield 2; 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-es6-import/test1-in.js: -------------------------------------------------------------------------------- 1 | import * as Z from "@effectful/generators"; 2 | 3 | function* a() { 4 | yield 1; 5 | yield 2; 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test18-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff0(i++); 4 | eff1(i); 5 | i += 1; 6 | eff2(2); 7 | eff3((i += 2)); 8 | } 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test23-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0, 3 | j = 0; 4 | eff0(eff1(eff2(i++, eff3(eff4(i, j), j++), eff5(i)), i++), i); 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test49-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(eff(1), _1); 4 | function _1() {} 5 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test02-out-f.js: -------------------------------------------------------------------------------- 1 | import * as _M from "@effectful/core"; 2 | function M() { 3 | return _M.chain(eff(2), _1); 4 | function _1() {} 5 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test20-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | console.log(eff("1"), 3); 3 | console.log("2"); 4 | console.log("3"); 5 | return eff(2); 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test09-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | for (let i = init(); check() === true; upd()) 3 | if (a) eff(1); 4 | else continue; 5 | } 6 | -------------------------------------------------------------------------------- /packages/es-inline/.npmignore: -------------------------------------------------------------------------------- 1 | .git 2 | tmp-* 3 | *.orig 4 | *.log 5 | *~ 6 | *.map 7 | .DS_Store 8 | .tern-port 9 | node_modules 10 | src 11 | test 12 | packages 13 | -------------------------------------------------------------------------------- /packages/js/babel-preset-zero-config.js: -------------------------------------------------------------------------------- 1 | module.exports = require("@effectful/debugger/config/babel/preset-zero-config").rebind(require.resolve("./babel-plugin-transform")); 2 | -------------------------------------------------------------------------------- /packages/transducers/test/kit/inject.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | if (typeof EDBG === "undefined") 3 | require("@babel/register")({ ignore: ["@effectful/**/*"] }); 4 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-detect/with-import/test1-in.js: -------------------------------------------------------------------------------- 1 | import Z from "@effectful/generators"; 2 | 3 | function* a() { 4 | yield 1; 5 | yield 2; 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test05-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff1(); 3 | for (eff2(); eff(3); eff4()) { 4 | eff5(); 5 | eff6(); 6 | } 7 | eff7(); 8 | } 9 | -------------------------------------------------------------------------------- /packages/es-persist-serialization/transform.js: -------------------------------------------------------------------------------- 1 | module.exports = require("@effectful/es-persist/transform").options({ 2 | importRT: "@effectful/es-persist-serialization" 3 | }); 4 | -------------------------------------------------------------------------------- /packages/transducers-loose/test/kit/inject.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | if (typeof EDBG === "undefined") require("@babel/register")({ 3 | ignore: ["@effectful/**/*"] 4 | }); -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/test2-in.js: -------------------------------------------------------------------------------- 1 | // *- when it is the last statement 2 | (function() { 3 | lab: { 4 | if (eff(2)) break lab; 5 | else eff(3); 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/test4-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | lab: { 3 | eff(1); 4 | break lab; 5 | eff(2); 6 | } 7 | eff(3); 8 | eff(4); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/wrap-top.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/core", 3 | "importRT": "@effectful/core", 4 | "profile": "es", 5 | "topIIFE": true 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test20-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff0(i); 4 | i++; 5 | eff1(i); 6 | eff1(i); 7 | i++; 8 | eff1(i); 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test33-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff(1); 3 | if (eff(2)) { 4 | eff3(); 5 | eff4(); 6 | } else { 7 | b; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/generators/test02.opts: -------------------------------------------------------------------------------- 1 | { 2 | "require": "@effectful/es", 3 | "scopeContext":true, 4 | "contextState":true, 5 | "contextMethodOps":true 6 | } 7 | -------------------------------------------------------------------------------- /packages/debugger/api/modules/_timetravel_setup_.md: -------------------------------------------------------------------------------- 1 | [@effectful/debugger](../README.md) › ["timeTravel/setup"](_timetravel_setup_.md) 2 | 3 | # Module: "timeTravel/setup" 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/es/babel.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@babel/syntax-async-generators", 3 | "@babel/syntax-function-sent", 4 | "@babel/plugin-syntax-jsx"] 5 | } 6 | -------------------------------------------------------------------------------- /packages/vscode-debugger/.vscode-test.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from '@vscode/test-cli'; 2 | 3 | export default defineConfig({ 4 | files: 'out/test/extension/**/*.test.js', 5 | }); 6 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/child_process1.js: -------------------------------------------------------------------------------- 1 | require("child_process").spawn("node", [`${__dirname}/child_process2`], { 2 | stdio: "inherit" 3 | }); 4 | console.log("IN CP1"); 5 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/options/wrap-top.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/core", 3 | "importRT": "@effectful/core", 4 | "profile": "es", 5 | "topIIFE": true 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/simple/generators/test02.opts: -------------------------------------------------------------------------------- 1 | { 2 | "require": "@effectful/es", 3 | "scopeContext":true, 4 | "contextState":true, 5 | "contextMethodOps":true 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/with-assign/test1-in.js: -------------------------------------------------------------------------------- 1 | var Z; 2 | Z = require("@effectful/generators"); 3 | 4 | function* a() { 5 | yield 1; 6 | yield 2; 7 | } 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-es6-import/with-import-default/test1-in.js: -------------------------------------------------------------------------------- 1 | import Z from "@effectful/generators"; 2 | 3 | function* a() { 4 | yield 1; 5 | yield 2; 6 | } 7 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/reverseContinueESM2.js: -------------------------------------------------------------------------------- 1 | import * as D1 from "./reverseContinueESM3"; 2 | import * as D2 from "./reverseContinueESM3"; 3 | 4 | export { D1, D2} 5 | 6 | -------------------------------------------------------------------------------- /packages/es/test/samples/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "sourceType": "script", 3 | "plugins": ["@babel/plugin-syntax-function-sent", 4 | "@babel/plugin-syntax-async-generators"] 5 | } 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | 7 | [*.{js,json,yml}] 8 | charset = utf-8 9 | indent_style = space 10 | indent_size = 2 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-es6-import/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "profile": null 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "profile": null 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/es-block.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/core", 3 | "importRT": "@effectful/core", 4 | "profile": "es", 5 | "blockDirsFunc": "block" 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/es-persist/api/README.md: -------------------------------------------------------------------------------- 1 | [@effectful/es-persist](README.md) 2 | 3 | # @effectful/es-persist 4 | 5 | ## Index 6 | 7 | ### Modules 8 | 9 | * ["types"](modules/_types_.md) 10 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/programSingleLine.js: -------------------------------------------------------------------------------- 1 | console.log("1"); console.log("2"); console.log("3"); console.log("4"); console.log("5"); console.log("6"); console.log("7"); -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "regenerator"] 2 | shallow = true 3 | path = packages/es/test/deps/regenerator 4 | url = https://github.com/facebook/regenerator.git 5 | branch = main 6 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/inject-runtime/with-es6-import/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "profile": null 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/inject-runtime/without-import/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "profile": null 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/options/es-block.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/core", 3 | "importRT": "@effectful/core", 4 | "profile": "es", 5 | "blockDirsFunc": "block" 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/core/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | src 3 | test 4 | .tern* 5 | .babelrc 6 | .DS_Store 7 | .git 8 | dist 9 | tmp-* 10 | *.orig 11 | *.log 12 | *~ 13 | *.map 14 | npm-debug.log 15 | 16 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test13-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | if (t) { 4 | eff1(i); 5 | } else { 6 | i++; 7 | } 8 | eff2(i); 9 | eff3(i); 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test15-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | i++; 4 | eff1(i); 5 | if (t) { 6 | eff2(i); 7 | } else { 8 | eff3(i); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test48-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | return M.chain(eff(1), _1); 6 | function _1() {} 7 | } -------------------------------------------------------------------------------- /packages/es-inline/test/right/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "sourceType": "script", 3 | "plugins": [["../../transform",{"modules":"commonjs","left":false,"generators": {"bodyCommentHack":"regenerator"}}]] 4 | } 5 | -------------------------------------------------------------------------------- /packages/es/test/samples/src/lib/util.js: -------------------------------------------------------------------------------- 1 | // dummy stub needed for regenerator tests 2 | 3 | exports.runtimeProperty = function() { 4 | return { object: { name: "regeneratorRuntime" } }; 5 | }; 6 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/stepsTest.js: -------------------------------------------------------------------------------- 1 | let i = 0; 2 | function func1() { 3 | i++; 4 | func2(); 5 | } 6 | function func2() { 7 | i*=10; 8 | } 9 | func1(); 10 | console.log(i); 11 | -------------------------------------------------------------------------------- /packages/core-loose/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | src 3 | test 4 | .tern* 5 | .babelrc 6 | .DS_Store 7 | .git 8 | dist 9 | tmp-* 10 | *.orig 11 | *.log 12 | *~ 13 | *.map 14 | npm-debug.log 15 | 16 | -------------------------------------------------------------------------------- /packages/core/src/v2/context.js: -------------------------------------------------------------------------------- 1 | // stores current File's root node to avoid passing it to each function 2 | export let file = null; 3 | export let root = null 4 | 5 | export function setRoot(r) { root = r } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-detect/with-import/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "detectRT": "@effectful/generators", 4 | "profile": null 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-detect/without-import/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "detectRT": "@effectful/generators", 4 | "profile": null 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test02-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i, a; 4 | a = i++; 5 | return M.chain(eff1(a), _1); 6 | function _1() {} 7 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test14-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff(i); 4 | if (i++) { 5 | eff1(i); 6 | } else { 7 | eff2(i); 8 | } 9 | eff(i); 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test06-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(eff(1), _1); 4 | function _1(a) { 5 | console.log(a, 2); 6 | } 7 | } -------------------------------------------------------------------------------- /packages/es-inline/test/default/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "sourceType": "script", 3 | "plugins": [["../../transform",{"modules":"commonjs", 4 | "generators": {"bodyCommentHack":"regenerator"}}]] 5 | } 6 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/funconstr.js: -------------------------------------------------------------------------------- 1 | const f = new Function( 2 | "a", 3 | ` 4 | console.log("line1",a); 5 | debugger; 6 | console.log("line3",a); 7 | ` 8 | ); 9 | f(1); 10 | f(2); 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/newtarget-in.js: -------------------------------------------------------------------------------- 1 | M.option({ scopePrefix: true, passNewTarget: true }); 2 | 3 | function a1(a) { 4 | this.a = a; 5 | } 6 | 7 | function b() { 8 | a1(); 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test07-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | try { 3 | eff(1); 4 | } finally { 5 | console.log(1); 6 | eff(2); 7 | console.log(2); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/es-persist/test/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins":[ 3 | ["../transform", {"importRT":"../index"}], 4 | ["@babel/plugin-transform-modules-commonjs", 5 | {"strict":false,"loose":true}]] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "modules": "commonjs", 5 | "profile": null 6 | } 7 | 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-es6-import/with-import-default/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "profile": null 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/par/seq-bind-in.js: -------------------------------------------------------------------------------- 1 | // *- SKIP 2 | function a$def() { 3 | eff(1) + eff(2); 4 | } 5 | 6 | M.option({ expr: "seq" }); 7 | 8 | function a$seq() { 9 | eff(1) + eff(2); 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test03-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff0(); 3 | var i = 0; 4 | i++; 5 | eff1(i); 6 | if (t) { 7 | eff2(i); 8 | } else { 9 | eff3(i); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test25-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i; 3 | if (ee) { 4 | eff1(i++); 5 | eff2(i++); 6 | } else { 7 | eff1(i++); 8 | eff2(i++); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test05-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | try { 3 | eff(1); 4 | } catch (e) { 5 | console.log(e); 6 | } finally { 7 | console.log("fin"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test06-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | try { 3 | eff(1); 4 | } catch (e) { 5 | console.log(e, 1); 6 | eff(2); 7 | console.log(e, 2); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test04-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var j; 3 | eff1(); 4 | for (var i = eff2(); i < 10; i++) { 5 | eff3(i, j); 6 | eff4(j++); 7 | } 8 | eff7(i); 9 | } 10 | -------------------------------------------------------------------------------- /packages/es-persist/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "es2015", 5 | "lib": ["es6"] 6 | }, 7 | "include": ["main.d.ts","types.ts"] 8 | } 9 | 10 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/inject-runtime/with-es6-import/with-import-default/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "profile": null 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/others/require-no-prefix-in.js: -------------------------------------------------------------------------------- 1 | const a = require("module-A"); 2 | const b = require(a+"module-B"); 3 | const c = require("node:url"); 4 | const d = import("module-D"); 5 | module.exports = b; 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/others/require-no-prefix-out-f.js: -------------------------------------------------------------------------------- 1 | const a = require("module-A"); 2 | const b = require(a + "module-B"); 3 | const c = require("node:url"); 4 | const d = import("module-D"); 5 | module.exports = b; -------------------------------------------------------------------------------- /packages/core/test/samples/others/require-no-prefix-out-ft.js: -------------------------------------------------------------------------------- 1 | const a = require("module-A"); 2 | const b = require(a + "module-B"); 3 | const c = require("node:url"); 4 | const d = import("module-D"); 5 | module.exports = b; -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test42-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff1(); 3 | eff2(); 4 | lab1: { 5 | eff3(); 6 | if (eff(4)) break lab1; 7 | else return; 8 | } 9 | eff(5); 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test51-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff1(1); 3 | a; 4 | if (test) { 5 | b; 6 | eff(3); 7 | c; 8 | eff(4); 9 | } else eff(5); 10 | eff(6); 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test52-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff1(1); 3 | a; 4 | if (test(1)) { 5 | b; 6 | eff(3); 7 | c; 8 | eff(4); 9 | } else eff(5); 10 | eff(6); 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test55-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff1(1); 3 | a; 4 | if (test) { 5 | b; 6 | eff(3); 7 | c; 8 | eff(4); 9 | } else eff(5); 10 | eff(6); 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test56-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff1(1); 3 | a; 4 | if (test(1)) { 5 | b; 6 | eff(3); 7 | c; 8 | eff(4); 9 | } else eff(5); 10 | eff(6); 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test06-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i; 3 | eff1(); 4 | for (i = eff2(); i !== eff(3); i = eff4(i)) { 5 | eff5(i); 6 | eff6(i); 7 | } 8 | eff7(i); 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/try-stmt/finally-section/test1-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | try { 3 | if (eff("in body")) return; 4 | } finally { 5 | eff("in `finally`"); 6 | } 7 | eff("after `finally`"); 8 | } 9 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/columns.js: -------------------------------------------------------------------------------- 1 | let i = 0; for(let i = 0;i>10;i++) console.log(i); for(let i;i>10;) console.log(i); if (i > 0) while(false) console.log("F"); else { do { console.log("D") } while(false) } 2 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/function constructor.js: -------------------------------------------------------------------------------- 1 | (new Function( 2 | "a", 3 | "b", 4 | "c", 5 | `console.log("L1",a); 6 | console.log("L2",b); 7 | console.log("L3",c); 8 | ` 9 | ))(10,20,30); 10 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/inject-runtime/with-commonjs/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "modules": "commonjs", 5 | "profile": null 6 | } 7 | 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/do-while-stmt/body-eff/it-has-break-stmt/test1-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | do { 3 | if (eff(1)) continue; 4 | if (eff(2)) break; 5 | eff(3); 6 | } while (eff(4)); 7 | eff(5); 8 | }); 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/for-stmt/body-eff/test1-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var i, j, len, ref; 3 | ref = [1, 2, 3]; 4 | for (j = 0, len = ref.length; j < len; j++) { 5 | i = ref[j]; 6 | eff(i); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/with-conflict/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "modules": "commonjs", 5 | "profile": null 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/clos-conv.opts: -------------------------------------------------------------------------------- 1 | { 2 | "injectFuncMeta": "meta", 3 | "metaParentClosure": true, 4 | "topLevel": true, 5 | "topIIFE": true, 6 | "closConv": true, 7 | "contextState": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test01-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(eff(1), _1); 4 | function _1(a) { 5 | throw a; 6 | } 7 | function _2() {} 8 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test02-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(eff(1), _1); 4 | function _1(a) { 5 | throw a; 6 | } 7 | function _2() {} 8 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test08-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | for (var i = init(); check() === true; upd()) { 3 | b1(); 4 | if (v) { 5 | e(); 6 | continue; 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/es-inline/options.js: -------------------------------------------------------------------------------- 1 | const esOptions = require("@effectful/es/options"); 2 | 3 | module.exports = function esProfile(opts) { 4 | return esOptions(Object.assign({}, { inline: true, defunct: true }, opts)); 5 | }; 6 | -------------------------------------------------------------------------------- /packages/es-persist-serialization/test/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | ["../transform", {"importRT":"../index"}], 4 | ["@babel/plugin-transform-modules-commonjs", 5 | {strict:false,loose:true}]] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/extensionTest.js: -------------------------------------------------------------------------------- 1 | let i = 0; 2 | function func1() { 3 | i++; 4 | func2(); 5 | } 6 | function func2() { 7 | debugger; 8 | i *= 10; 9 | } 10 | func1(); 11 | console.log(i); 12 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/sourcemaps-entrypoint/index.ts: -------------------------------------------------------------------------------- 1 | // Intentional blank line goes after this line 2 | 3 | hello() 4 | hello() 5 | hello() 6 | 7 | function hello() { 8 | return 'hello' 9 | } -------------------------------------------------------------------------------- /packages/core-loose/test/samples/inject-runtime/with-commonjs/with-conflict/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "modules": "commonjs", 5 | "profile": null 6 | } 7 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/options/clos-conv.opts: -------------------------------------------------------------------------------- 1 | { 2 | "injectFuncMeta": "meta", 3 | "metaParentClosure": true, 4 | "topLevel": true, 5 | "topIIFE": true, 6 | "closConv": true, 7 | "contextState": true 8 | } 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/with-name-conflict/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "profile": null, 5 | "ns": null 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test16-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | { 4 | i++; 5 | eff1(i); 6 | } 7 | eff(i); 8 | { 9 | i++; 10 | } 11 | { 12 | eff2(i); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test21-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0, 3 | j = 0; 4 | eff0(i++, j++); 5 | eff1(i); 6 | i += 1; 7 | eff2(2, j); 8 | eff3((i += 2), j); 9 | eff4(j); 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test11-out-f.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i, j, len, ref1; 3 | ref1 = [1, 2, 3]; 4 | for (j = 0, len = ref1.length; j < len; j++) { 5 | i = ref1[j]; 6 | console.log(i); 7 | } 8 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test11-out-ft.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i, j, len, ref1; 3 | ref1 = [1, 2, 3]; 4 | for (j = 0, len = ref1.length; j < len; j++) { 5 | i = ref1[j]; 6 | console.log(i); 7 | } 8 | } -------------------------------------------------------------------------------- /packages/es/.npmignore: -------------------------------------------------------------------------------- 1 | .git 2 | tmp-* 3 | *.orig 4 | *.log 5 | *~ 6 | *.map 7 | .DS_Store 8 | .tern-port 9 | node_modules 10 | src 11 | test 12 | packages 13 | babel.loose.json 14 | babel.test.json 15 | babel.cjs.json 16 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/evalCond.js: -------------------------------------------------------------------------------- 1 | let i = 2; 2 | global.i = 0; 3 | eval(` 4 | debugger; 5 | for(let j = 0; j < 3; j++) { 6 | console.log("I",i); 7 | i++; 8 | } 9 | `); 10 | debugger; 11 | console.log(i); 12 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/programWithOutput.js: -------------------------------------------------------------------------------- 1 | for (var i = 0; i < 3; i++) { 2 | console.error("Hello stderr " + i); 3 | } 4 | for (var i = 0; i < 3; i++) { 5 | console.log("Hello stdout " + i); 6 | } 7 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/inject-runtime/without-import/with-name-conflict/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "profile": null, 5 | "ns": null 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/core/test/samples.js: -------------------------------------------------------------------------------- 1 | import * as gen from "./kit/generators"; 2 | import * as dirs from "./kit/dirs"; 3 | import * as path from "path"; 4 | const files = dirs.read(path.join(__dirname, "samples")); 5 | gen.mochaBdd(files); 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/for-stmt/last/test1-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var i, j, len, ref; 3 | ref = [1, 2, 3]; 4 | for (j = 0, len = ref.length; j < len; j++) { 5 | i = ref[j]; 6 | if (eff(i)) break; 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/with-assign/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "modules": "commonjs", 5 | "profile": null 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test11-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i, j, len, ref1; 3 | ref1 = [1, 2, 3]; 4 | for (j = 0, len = ref1.length; j < len; j++) { 5 | i = ref1[j]; 6 | console.log(i); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/serialization/api/README.md: -------------------------------------------------------------------------------- 1 | [@effectful/serialization](README.md) 2 | 3 | # @effectful/serialization 4 | 5 | ## Index 6 | 7 | ### Modules 8 | 9 | * ["dom"](modules/_dom_.md) 10 | * ["main"](modules/_main_.md) 11 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/inject-runtime/with-commonjs/with-assign/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "modules": "commonjs", 5 | "profile": null 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/test3-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | (function () { 3 | return M.chain(eff(2), _1); 4 | function _1() { 5 | return M.chain(eff(4), _2); 6 | } 7 | function _2() {} 8 | }); -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/with-try-stmt/test3-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | lab: { 3 | try { 4 | eff(2); 5 | break lab; 6 | } catch (e) { 7 | eff(3); 8 | } 9 | } 10 | eff(4); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/module-descr.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/core", 3 | "importRT": "@effectful/core", 4 | "profile": "es", 5 | "injectModuleMeta": "module", 6 | "wrapFunction": "eff" 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test32-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(eff(1), _1); 4 | function _1() { 5 | return M.chain(eff(2), _2); 6 | } 7 | function _2() {} 8 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test62-in.js: -------------------------------------------------------------------------------- 1 | function a(i) { 2 | var j, 3 | k = 0; 4 | eff(i); 5 | eff(i++, (j = 1)); 6 | eff(j++, k++); 7 | eff(i); 8 | eff((j = 3)); 9 | eff(j); 10 | eff(i); 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/profiles/test01-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(eff(1), _1); 4 | function _1() { 5 | return M.chain(eff(2), _2); 6 | } 7 | function _2() {} 8 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/profiles/test02-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function e() { 3 | return M.chain(eff1(), _1); 4 | function _1() { 5 | return M.chain(eff2(), _2); 6 | } 7 | function _2() {} 8 | } -------------------------------------------------------------------------------- /packages/core/test/samples/switch-stmt/test4-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | switch (eff(1)) { 3 | case 1: 4 | effB(1); 5 | case 2: 6 | effB(2); 7 | break; 8 | default: 9 | effB(3); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/debugger/test/setup.js: -------------------------------------------------------------------------------- 1 | const config = require("../config").default; 2 | const D = require("../state"); 3 | D.context.debug = true; 4 | D.context.needsBreak = () => true; 5 | config.verbose = false; 6 | module.exports = config; 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/with-try-stmt/test2-in.js: -------------------------------------------------------------------------------- 1 | // *- when it is the last statement 2 | (function() { 3 | lab: { 4 | try { 5 | break lab; 6 | } catch (e) { 7 | eff(3); 8 | } 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/with-commonjs-target/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "profile": null, 5 | "modules": "commonjs" 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test22-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0, 3 | j = 0; 4 | eff0(i, j); 5 | eff1(i++, j++); 6 | eff2(i); 7 | i += 1; 8 | eff3(2, j); 9 | eff4((i += 2), j); 10 | eff5(j); 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test03-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(eff(3), _1); 4 | function _1(b) { 5 | var a; 6 | a = console.log(2 + b); 7 | 1 + a + 4; 8 | } 9 | } -------------------------------------------------------------------------------- /packages/debugger/instr/dom.d.ts: -------------------------------------------------------------------------------- 1 | export declare const callbacks: { 2 | dispatchErrorEvent?: (error: any) => void; 3 | }; 4 | export declare function dispatchEventImpl(ev: Event, map: Iterable): boolean; 5 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/breakpoints.js: -------------------------------------------------------------------------------- 1 | let i = 0; 2 | i++; 3 | i++; 4 | // 5 | function func1() { (function func2() { 6 | /* 7 | 8 | 9 | 10 | */ 11 | i++; 12 | for(;i<6;) i++; 13 | })() 14 | } 15 | i++; 16 | func1(); 17 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/exceptionBreakpoints.js: -------------------------------------------------------------------------------- 1 | function func1() { 2 | throw new Error("error"); 3 | } 4 | function func2() { 5 | try { 6 | func1(); 7 | } catch (e) { 8 | throw e; 9 | } 10 | } 11 | func2(); 12 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/breakpoints.js: -------------------------------------------------------------------------------- 1 | let i = 0; 2 | i++; 3 | i++; 4 | // 5 | function func1() { (function func2() { 6 | /* 7 | 8 | 9 | 10 | */ 11 | i++; 12 | for(;i<6;) i++; 13 | })() 14 | } 15 | i++; 16 | func1(); 17 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/inject-runtime/without-import/with-commonjs-target/test1.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/generators", 3 | "importRT": "@effectful/generators", 4 | "profile": null, 5 | "modules": "commonjs" 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/options/module-descr.opts: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "@effectful/core", 3 | "importRT": "@effectful/core", 4 | "profile": "es", 5 | "injectModuleMeta": "module", 6 | "wrapFunction": "eff" 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /packages/core/babel/ts-preproc.js: -------------------------------------------------------------------------------- 1 | module.exports = function(_, opts) { 2 | return { 3 | plugins: [ 4 | require.resolve("./ts-no-consts"), 5 | [require.resolve("@babel/plugin-transform-typescript"), opts] 6 | ] 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test10-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | loo: for (let i = init(); check() === true; upd()) 3 | for (let j = initJ(); checkJ() === true; updJ()) 4 | if (i === j) continue; 5 | else continue loo; 6 | } 7 | -------------------------------------------------------------------------------- /samples/react-do/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@babel/plugin-transform-modules-commonjs"], 3 | "env": { 4 | "test": { 5 | "presets": ["@babel/preset-react"], 6 | "plugins": ["babel-plugin-macros"] 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test49-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test01-in.js: -------------------------------------------------------------------------------- 1 | // *- should inject forPar 2 | function a() { 3 | eff1(); 4 | for (var i = eff2(); i < 10; i++) { 5 | var j = eff3(i); 6 | eff4(j++); 7 | } 8 | console.log(eff7(i)); 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/switch-stmt/test6-in.js: -------------------------------------------------------------------------------- 1 | // *- without default branch 2 | function a() { 3 | switch (eff(1)) { 4 | case 1: 5 | effB(1); 6 | break; 7 | case 2: 8 | effB(2); 9 | break; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/mod.js: -------------------------------------------------------------------------------- 1 | const mod = require("./mod1"); 2 | console.log("> M:", mod); 3 | const mod1 = require("./mod1"); 4 | console.log("> M1:", mod1); 5 | const mod2 = require("./mod2"); 6 | console.log("> M2:", mod2); 7 | mod.run(); 8 | -------------------------------------------------------------------------------- /packages/es-persist/rollup.config.mjs: -------------------------------------------------------------------------------- 1 | import resolve from "@rollup/plugin-node-resolve"; 2 | export default { 3 | input: "main.js", 4 | output: { 5 | file: "index.js", 6 | format: "cjs" 7 | }, 8 | plugins: [resolve()] 9 | }; 10 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/restart-custom.js: -------------------------------------------------------------------------------- 1 | console.log("BEFORE"); 2 | if (typeof EDBG !== "undefined") { 3 | let state; 4 | EDBG.config.onRestart = () => EDBG.restore(state); 5 | state = EDBG.capture(true); 6 | } 7 | console.log("AFTER"); 8 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/programWithDebugger.js: -------------------------------------------------------------------------------- 1 | var a = []; 2 | a.push("line 1"); 3 | a.push("line 2"); 4 | a.push("line 3"); 5 | 6 | debugger; 7 | 8 | a.push("line 4"); 9 | a.push("line 5"); 10 | a.push("line 6"); 11 | -------------------------------------------------------------------------------- /packages/core/test/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [["@babel/plugin-transform-modules-commonjs", 3 | {"loose":true,"noInterop":true}], 4 | "@babel/syntax-async-generators", 5 | "@babel/syntax-function-sent"] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/if-stmt/condition-eff-in.js: -------------------------------------------------------------------------------- 1 | // *- when branches are pure but its condition has effects 2 | // *- should bind statement's condition part using fmap 3 | function a() { 4 | if (eff(1)) console.log(1); 5 | else console.log(2); 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/others/require-prefix-in.js: -------------------------------------------------------------------------------- 1 | const a = require("module-A"); 2 | const b = require(`${a}module-B`); 3 | const c = require("node:url"); 4 | const d = import("module-D"); 5 | const f = import(`module-${d.name}`); 6 | module.exports = b; 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/others/require-prefix-out-f.js: -------------------------------------------------------------------------------- 1 | const a = require("module-A"); 2 | const b = require(`${a}module-B`); 3 | const c = require("node:url"); 4 | const d = import("module-D"); 5 | const f = import(`module-${d.name}`); 6 | module.exports = b; -------------------------------------------------------------------------------- /packages/core/test/samples/others/require-prefix-out-ft.js: -------------------------------------------------------------------------------- 1 | const a = require("module-A"); 2 | const b = require(`${a}module-B`); 3 | const c = require("node:url"); 4 | const d = import("module-D"); 5 | const f = import(`module-${d.name}`); 6 | module.exports = b; -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test61-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | let i = 0; 3 | eff1(i); 4 | lab: { 5 | eff2(i++); 6 | if (i) { 7 | i++; 8 | break lab; 9 | } 10 | eff3(i++); 11 | } 12 | eff4(i++); 13 | } 14 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test02-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as _M from "@effectful/core"; 2 | function M() { 3 | var M = _M.context(); 4 | return _M.scope(M_1); 5 | } 6 | function M_1(M) { 7 | return _M.chain(eff(2), M_2); 8 | } 9 | function M_2(M) {} -------------------------------------------------------------------------------- /packages/debugger/config/babel/ts-preproc.js: -------------------------------------------------------------------------------- 1 | module.exports = function(_, opts) { 2 | return { 3 | plugins: [ 4 | require.resolve("./ts-no-consts"), 5 | [require.resolve("@babel/plugin-transform-typescript"), opts] 6 | ] 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/vscode-debugger/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "ms-vscode.vscode-typescript-tslint-plugin" 6 | ] 7 | } -------------------------------------------------------------------------------- /samples/react-do/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | src 3 | test 4 | .tern* 5 | .babelrc 6 | .DS_Store 7 | .git 8 | tmp-* 9 | *.orig 10 | *.log 11 | *~ 12 | *.map 13 | npm-debug.log 14 | .gitignore 15 | .env 16 | .eslintrc 17 | .eslintignore 18 | *.test.js 19 | -------------------------------------------------------------------------------- /packages/core-loose/test/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [["@babel/plugin-transform-modules-commonjs", 3 | {"loose":true,"noInterop":true}], 4 | "@babel/syntax-async-generators", 5 | "@babel/syntax-function-sent"] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /packages/core/test/samples/operations/block-stmt-in.js: -------------------------------------------------------------------------------- 1 | // *- SKIP 2 | M.option({ closure: false, state: false, persistence: true }); 3 | 4 | function a() { 5 | eff1(eff(2), eff(3)); 6 | } 7 | 8 | function b() { 9 | eff1(eff(i++), eff(i++)); 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test04-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff0(); 3 | var i = 0; 4 | i++; 5 | eff1(i); 6 | if (t) { 7 | eff2(i); 8 | i++; 9 | eff4(i); 10 | } else { 11 | eff3(i); 12 | } 13 | eff5(i); 14 | } 15 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test37-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var r; 4 | if (true) { 5 | 1 + 1; 6 | } 7 | return M.chain(M.pure(), _1); 8 | function _1(a) { 9 | return a; 10 | } 11 | } -------------------------------------------------------------------------------- /packages/debugger/test/regenerator.test.js: -------------------------------------------------------------------------------- 1 | require("./setup"); 2 | const { describe, run, opts } = require("./setup-regenerator"); 3 | 4 | describe("regenerator run", function() { 5 | opts.debug = false; 6 | run(require("./es/links/regenerator")); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/es-persist-serialization/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | src 3 | test 4 | .tern* 5 | .babelrc 6 | .DS_Store 7 | .git 8 | tmp-* 9 | *.orig 10 | *.log 11 | *~ 12 | *.map 13 | npm-debug.log 14 | .gitignore 15 | .env 16 | .eslintrc 17 | .eslintignore 18 | -------------------------------------------------------------------------------- /packages/es-persist-serialization/rollup.config.js: -------------------------------------------------------------------------------- 1 | import resolve from "@rollup/plugin-node-resolve"; 2 | export default { 3 | input: "main.js", 4 | output: { 5 | file: "index.js", 6 | format: "cjs" 7 | }, 8 | plugins: [resolve()] 9 | }; 10 | -------------------------------------------------------------------------------- /packages/core/src/options.js: -------------------------------------------------------------------------------- 1 | import { enableIf } from "./kit"; 2 | 3 | export const ifDirectives = enableIf(i => i.$ns && i.opts.directives !== false); 4 | export const ifLoose = enableIf(i => i.opts.loose); 5 | export const ifDefunct = enableIf(i => i.opts.defunct); 6 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test10-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff0(); 3 | var i = 0; 4 | i++; 5 | eff1(i); 6 | i++; 7 | if (t) { 8 | eff2(i); 9 | i++; 10 | eff4(i); 11 | } else { 12 | t; 13 | } 14 | eff5(i); 15 | } 16 | -------------------------------------------------------------------------------- /packages/core/test/samples/switch-stmt/test3-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | lab: switch (eff(1)) { 3 | case 1: 4 | effB(1); 5 | break; 6 | case 2: 7 | effB(2); 8 | break lab; 9 | default: 10 | effB(3); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/debugger/test/regenerator-debug.test.js: -------------------------------------------------------------------------------- 1 | require("./setup"); 2 | const { describe, run, opts } = require("./setup-regenerator"); 3 | 4 | describe("regenerator trace", function() { 5 | opts.debug = true; 6 | run(require("./es/links/regenerator")); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/es-persist/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | rollup.config.js 3 | src 4 | test 5 | .tern* 6 | .babelrc 7 | .DS_Store 8 | .git 9 | tmp-* 10 | *.orig 11 | *.log 12 | *~ 13 | *.map 14 | npm-debug.log 15 | .gitignore 16 | .env 17 | .eslintrc 18 | .eslintignore 19 | -------------------------------------------------------------------------------- /packages/cc/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | src 3 | test 4 | .tern* 5 | .babelrc 6 | .DS_Store 7 | .git 8 | tmp-* 9 | *.orig 10 | *.log 11 | *~ 12 | *.map 13 | npm-debug.log 14 | rollup.config.js 15 | .gitignore 16 | .env 17 | .eslintrc 18 | .eslintignore 19 | api 20 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test11-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff0(); 3 | var i = 0; 4 | i++; 5 | eff1(i); 6 | i++; 7 | if (t) { 8 | eff2(i); 9 | i++; 10 | eff4(i); 11 | } else { 12 | i++; 13 | } 14 | eff5(i); 15 | } 16 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test58-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff0(); 4 | i += 2; 5 | effM(); 6 | effN(); 7 | eff1(eff2(effI1(++i)), i++, eff3(i)); 8 | effM(effI(effN())); 9 | eff4(effI(), effJ()); 10 | eff5(); 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test05-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(effb(2), _1); 4 | function _1(a) { 5 | return M.chain(eff(a), _2); 6 | } 7 | function _2(a) { 8 | a + 2; 9 | } 10 | } -------------------------------------------------------------------------------- /packages/core/test/samples/switch-stmt/test2-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | switch (eff(1)) { 3 | case check(1): 4 | effB(1); 5 | break; 6 | case check(2): 7 | effB(2); 8 | break; 9 | default: 10 | effB(3); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/core/test/samples/try-stmt/opt-catch-bind-in.js: -------------------------------------------------------------------------------- 1 | function a1(a, b) { 2 | try { 3 | eff(a); 4 | } catch { 5 | eff(b); 6 | } 7 | } 8 | 9 | function a2(a, b) { 10 | try { 11 | eff(a); 12 | } catch { 13 | return b; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/funconstr.js: -------------------------------------------------------------------------------- 1 | const f = new Function( 2 | "a", 3 | ` 4 | console.log("line1",a); 5 | debugger; 6 | for(let i = 0; i < 3; i++) { 7 | console.log("I:",i) 8 | } 9 | console.log("line3",a); 10 | ` 11 | ); 12 | f(1); 13 | f(2); 14 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/mod1.js: -------------------------------------------------------------------------------- 1 | import * as M2 from "./mod2"; 2 | 3 | let j = 0; 4 | 5 | export function run(i = 1) { 6 | j += i; 7 | M2.f2(M2.f1(i++), i); 8 | j += i; 9 | console.log(`i:${i},j:${j}`); 10 | } 11 | 12 | run(); 13 | run(); 14 | -------------------------------------------------------------------------------- /packages/es-rt/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | src 3 | test 4 | .tern* 5 | .babelrc 6 | .DS_Store 7 | .git 8 | tmp-* 9 | *.orig 10 | *.log 11 | *~ 12 | *.map 13 | npm-debug.log 14 | rollup.config.js 15 | .gitignore 16 | .env 17 | .eslintrc 18 | .eslintignore 19 | 20 | -------------------------------------------------------------------------------- /packages/core/test/samples/placeholder/with-arg-in.js: -------------------------------------------------------------------------------- 1 | // *- SKIP 2 | function a() { 3 | var k = eff(1); 4 | M.$(k).eff(2); 5 | } 6 | 7 | function b() { 8 | var k = eff(1); 9 | eff(2); 10 | console.log(M.$(k).eff(3) + M.$(1).eff(4)); 11 | eff(5); 12 | } 13 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test53-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | return M.chain(eff2(2), _1); 6 | function _1(a) { 7 | return M.chain(eff1(a), _2); 8 | } 9 | function _2() {} 10 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test57-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | return M.chain(eff2(2), _1); 6 | function _1(a) { 7 | return M.chain(eff1(a), _2); 8 | } 9 | function _2() {} 10 | } -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/funconstr.js: -------------------------------------------------------------------------------- 1 | const f = new Function( 2 | "a", 3 | ` 4 | console.log("line1",a); 5 | debugger; 6 | for(let i = 0; i < 3; i++) { 7 | console.log("I:",i) 8 | } 9 | console.log("line3",a); 10 | ` 11 | ); 12 | f(1); 13 | f(2); 14 | -------------------------------------------------------------------------------- /packages/vscode-debugger/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | src/** 5 | .gitignore 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/tslint.json 9 | **/*.map 10 | **/*.ts 11 | testdata 12 | nolinks.js 13 | testExtension.js 14 | **/*.log -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/setTimeout.js: -------------------------------------------------------------------------------- 1 | async function delay() { 2 | console.log("BEFORE"); 3 | await new Promise(i => setTimeout(i,400)); 4 | console.log("AFTER"); 5 | } 6 | 7 | (async function main() { 8 | await delay(); 9 | await delay(); 10 | })() 11 | -------------------------------------------------------------------------------- /samples/persist-counters/README.md: -------------------------------------------------------------------------------- 1 | # Demo project for [@effectful/es-persist](https://github.com/awto/effectfuljs/tree/master/packages/es-persist) 2 | 3 | ## Usage: 4 | 5 | ``` 6 | $ npm run start 7 | ``` 8 | 9 | Open [http://localhost:8080](http://localhost:8080) 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/for-stmt/it-has-break-stmt/test1-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var i, j, len, ref; 3 | ref = [1, 2, 3]; 4 | for (j = 0, len = ref.length; j < len; j++) { 5 | i = ref[j]; 6 | if (eff(i)) break; 7 | } 8 | eff(2); 9 | eff(3); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/minimal-in.js: -------------------------------------------------------------------------------- 1 | M.profile("defaultMinimal"); 2 | 3 | function a() { 4 | eff(1); 5 | eff(2); 6 | return eff(3); 7 | } 8 | 9 | function b() { 10 | eff(1); 11 | M(eff(2)); 12 | eff(3); 13 | M(eff(4)); 14 | return 5; 15 | } 16 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test08-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff0(); 3 | var i = 0; 4 | i++; 5 | eff1(i); 6 | if (t) { 7 | eff2(i); 8 | i++; 9 | eff4(i); 10 | } else { 11 | t; 12 | } 13 | eff5(i); 14 | i++; 15 | eff6(i); 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test02-in.js: -------------------------------------------------------------------------------- 1 | // *- should inject forPar 2 | function a() { 3 | eff1(); 4 | var k; 5 | for (var i = eff2(), j = eff3(); i < 10 && j > -10; i++, j--) { 6 | var k = eff3(i); 7 | eff4(k++); 8 | } 9 | eff5(i, j); 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/profiles/test04-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | console.log("hi"); 3 | e1(); 4 | e2(); 5 | M.profile("minimal"); 6 | p1(); 7 | console.profile("minimal"); 8 | p2(); 9 | console.profileEnd(); 10 | M(e1()); 11 | M(e(2)); 12 | } 13 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/setImmediate.js: -------------------------------------------------------------------------------- 1 | async function delay() { 2 | console.log("BEFORE"); 3 | await new Promise(i => setImmediate(i)); 4 | console.log("AFTER"); 5 | } 6 | 7 | (async function main() { 8 | await delay(); 9 | await delay(); 10 | })() 11 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/transform/mod1.js: -------------------------------------------------------------------------------- 1 | import * as M2 from "./mod2"; 2 | 3 | let j = 0; 4 | 5 | export function run(i = 1) { 6 | j += i; 7 | M2.f2(M2.f1(i++), i); 8 | j += i; 9 | console.log(`i:${i},j:${j}`); 10 | } 11 | 12 | run(); 13 | run(); 14 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/setTimeout.js: -------------------------------------------------------------------------------- 1 | async function delay() { 2 | console.log("BEFORE"); 3 | await new Promise(i => setTimeout(i,400)); 4 | console.log("AFTER"); 5 | } 6 | 7 | (async function main() { 8 | await delay(); 9 | await delay(); 10 | })() 11 | -------------------------------------------------------------------------------- /packages/serialization-react/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | src 3 | test 4 | .tern* 5 | .babelrc 6 | .DS_Store 7 | .git 8 | tmp-* 9 | *.orig 10 | *.log 11 | *~ 12 | *.map 13 | npm-debug.log 14 | rollup.config.js 15 | .gitignore 16 | .env 17 | .eslintrc 18 | .eslintignore 19 | 20 | -------------------------------------------------------------------------------- /packages/serialization/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | src 3 | test 4 | .tern* 5 | .babelrc 6 | .DS_Store 7 | .git 8 | tmp-* 9 | *.orig 10 | *.log 11 | *~ 12 | *.map 13 | npm-debug.log 14 | rollup.config.js 15 | .gitignore 16 | .env 17 | .eslintrc 18 | .eslintignore 19 | api 20 | -------------------------------------------------------------------------------- /packages/transducers-loose/README.md: -------------------------------------------------------------------------------- 1 | # @effectful/transducers-loose 2 | 3 | Pre-built version of 4 | [@effectful/transducers](https://github.com/awto/effectfuljs/tree/master/packages/transducers). 5 | 6 | ## LICENSE 7 | 8 | Distributed under the terms of The MIT License (MIT). 9 | -------------------------------------------------------------------------------- /packages/core/src/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | [ 4 | "@babel/plugin-transform-modules-commonjs", 5 | { "loose": true, "noInterop": true } 6 | ], 7 | "@babel/plugin-transform-spread", 8 | "@babel/plugin-transform-object-rest-spread" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/meta-info-in.js: -------------------------------------------------------------------------------- 1 | function a2() { 2 | let i = 0; 3 | function c() { 4 | let m = 0; 5 | function b(j) { 6 | let k = j + i; 7 | i += m; 8 | return eff_1(); 9 | } 10 | i++; 11 | } 12 | return eff_2(); 13 | } 14 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test07-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff0(); 3 | var i = 0; 4 | i++; 5 | eff1(i); 6 | if (t) { 7 | eff2(i); 8 | i++; 9 | eff4(i); 10 | } else { 11 | eff3(); 12 | } 13 | eff5(i); 14 | i++; 15 | eff6(i); 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test09-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff0(); 3 | var i = 0; 4 | i++; 5 | eff1(i); 6 | if (t) { 7 | eff2(i); 8 | i++; 9 | eff4(i); 10 | } else { 11 | t + i; 12 | } 13 | eff5(i); 14 | i++; 15 | eff6(i); 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test17-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | return M.chain(eff1(i), _1); 6 | function _1() { 7 | i++; 8 | return M.chain(eff2(i), _2); 9 | } 10 | function _2() {} 11 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test30-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0, 3 | j = 0; 4 | function b(i) { 5 | eff1(i, j); 6 | i++, j++; 7 | eff2(i, j); 8 | } 9 | eff3(i, j); 10 | i++, j--; 11 | b(i); 12 | i--, j++; 13 | eff4(i, j); 14 | } 15 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test47-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | return M.chain(eff(1), _1); 6 | function _1() { 7 | i++; 8 | return M.chain(eff(2), _2); 9 | } 10 | function _2() {} 11 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test54-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | return M.chain(eff(1), _1); 6 | function _1() { 7 | i++; 8 | return M.chain(eff(2), _2); 9 | } 10 | function _2() {} 11 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test18-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var r; 4 | return M.chain(eff("1"), _1); 5 | function _1(a) { 6 | console.log(a, 3); 7 | console.log("2"); 8 | return console.log("3"); 9 | } 10 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test03-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var k = 0; 3 | eff1(); 4 | for (var i = eff2(); i < 10; i++) { 5 | k++; 6 | var j = eff3(i), 7 | l = eff4(i); 8 | l++; 9 | eff5(j++, k, l); 10 | } 11 | eff6(i, j, k); 12 | } 13 | -------------------------------------------------------------------------------- /packages/transducers/src/v2/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | browserDebug: typeof window !== "undefined" && window.chrome, 3 | debug: typeof window !== "undefined" || process.env.EFFECTFUL_DEBUG, 4 | color: typeof window !== "undefined" && window.chrome, 5 | verbose: false 6 | }; 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/if-stmt/all-pure-out-f.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (true) 2;else 3; 3 | return 1; 4 | } 5 | function b() { 6 | if (true) { 7 | console.log("a"); 8 | console.log("b"); 9 | } else { 10 | console.log("c"); 11 | console.log("d"); 12 | } 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/if-stmt/all-pure-out-ft.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (true) 2;else 3; 3 | return 1; 4 | } 5 | function b() { 6 | if (true) { 7 | console.log("a"); 8 | console.log("b"); 9 | } else { 10 | console.log("c"); 11 | console.log("d"); 12 | } 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/options/wrap-arg-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function z2() { 3 | var _args = M.args(arguments); 4 | ; 5 | return M.chain(eff(1), _1); 6 | function _1() { 7 | return M.chain(aff(_args), _2); 8 | } 9 | function _2() {} 10 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test05-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff0(); 3 | var i = 0; 4 | i++; 5 | eff1(i); 6 | if (t) { 7 | eff2(i); 8 | i++; 9 | eff4(i); 10 | } else { 11 | eff5(i); 12 | i++; 13 | eff6(i); 14 | } 15 | eff7(i); 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test06-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | eff0(); 3 | var i = 0; 4 | i++; 5 | eff1(i); 6 | if (t) { 7 | eff2(i); 8 | i++; 9 | eff4(i); 10 | } else { 11 | eff3(i); 12 | } 13 | eff5(i); 14 | i++; 15 | eff6(i); 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test48-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | var i; 8 | i = 0; 9 | return M.chain(eff(1), a_2); 10 | } 11 | function a_2(a) {} -------------------------------------------------------------------------------- /packages/es-rt/test/iterators.js: -------------------------------------------------------------------------------- 1 | var Lib = require("../src/main"); 2 | 3 | describe( 4 | Object.entries(Lib.opts) 5 | .map(([k, v]) => (v ? k : false)) 6 | .filter(i => i) 7 | .join(), 8 | function() { 9 | require("./templates/iterators")(Lib); 10 | } 11 | ); 12 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/with-try-stmt/test2-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | // *- when it is the last statement 3 | (function () { 4 | var e, ex; 5 | function _1() { 6 | e = ex; 7 | return M.chain(eff(3), _2); 8 | } 9 | function _2() {} 10 | }); -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test06-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | console.log(b, 2); 11 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/generators/functionSent-in.js: -------------------------------------------------------------------------------- 1 | M.profile("generators"); 2 | 3 | function* fSent() { 4 | var s = yield function.sent; 5 | yield* [1, 2, 3, function.sent]; 6 | console.log(s, function.sent); 7 | console.log(yield); 8 | console.log(yield); 9 | } 10 | -------------------------------------------------------------------------------- /packages/debugger/test/regenerator-time-travel.test.js: -------------------------------------------------------------------------------- 1 | require("./setup-time-travel"); 2 | const { describe, run, opts } = require("./setup-regenerator"); 3 | 4 | describe("regenerator run", function() { 5 | opts.debug = false; 6 | run(require("./es-time-travel/links/regenerator")); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/transducers/src/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | [ 4 | "@babel/plugin-transform-modules-commonjs", 5 | { "loose": true, "noInterop": true } 6 | ], 7 | "@babel/plugin-transform-spread", 8 | "@babel/plugin-transform-object-rest-spread" 9 | ], 10 | } 11 | -------------------------------------------------------------------------------- /packages/es-persist/transform.js: -------------------------------------------------------------------------------- 1 | module.exports = require("@effectful/es").options({ 2 | name: "@effectful/es-persist", 3 | importRT: "@effectful/es-persist", 4 | topLevel: true, 5 | defunct: true, 6 | par: false, 7 | effectful: { 8 | cleanupFrameVars: false 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/generators-out-ft.js: -------------------------------------------------------------------------------- 1 | // *- DEFAULT 2 | import * as G from "@effectful/es"; 3 | function c() { 4 | var c = G.generator(); 5 | return G.scope(c_1); 6 | } 7 | function c_1(c) { 8 | return G.yldStar(z, c_2); 9 | } 10 | function c_2(c) { 11 | return G.pure(); 12 | } -------------------------------------------------------------------------------- /packages/core/test/samples/options/identity-in.js: -------------------------------------------------------------------------------- 1 | // *- SKIP 2 | M.option.when("call && name === 'pp'", { identity: true }); 3 | M.option.whenExists("CallExpression[callee.name=pp] CallExpression", { 4 | bind: false 5 | }); 6 | 7 | function a() { 8 | console.log(pp(eff(1) + eff(2))); 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/test4-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | (function () { 3 | return M.chain(eff(1), _1); 4 | function _1() { 5 | return M.chain(eff(3), _2); 6 | } 7 | function _2() { 8 | return M.chain(eff(4), _3); 9 | } 10 | function _3() {} 11 | }); -------------------------------------------------------------------------------- /packages/core/test/samples/if-stmt/all-pure-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | if (true) 2; 3 | else 3; 4 | return 1; 5 | } 6 | 7 | function b() { 8 | if (true) { 9 | console.log("a"); 10 | console.log("b"); 11 | } else { 12 | console.log("c"); 13 | console.log("d"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/newtarget-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a1(a) { 3 | this.a = a; 4 | } 5 | function b() { 6 | return M.scope(_1); 7 | function _1() { 8 | var a; 9 | a = a1; 10 | return M.chain(a(), _2); 11 | } 12 | function _2() {} 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test24-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i, a; 4 | a = i++; 5 | return M.chain(eff1(a), _1); 6 | function _1() { 7 | var a; 8 | a = i++; 9 | return M.chain(eff2(a), _2); 10 | } 11 | function _2() {} 12 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test04-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function e() { 3 | var a; 4 | return M.chain(eff(1), _1); 5 | function _1(b) { 6 | a = b; 7 | return M.chain(eff(2), _2); 8 | } 9 | function _2(b) { 10 | console.log(a + b); 11 | } 12 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test08-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a; 4 | return M.chain(eff(1), _1); 5 | function _1(b) { 6 | a = b; 7 | return M.chain(eff(2), _2); 8 | } 9 | function _2(b) { 10 | console.log(a, b, 2); 11 | } 12 | } -------------------------------------------------------------------------------- /packages/core/test/samples/options/initial-scope-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function scope() { 3 | return M.otherScope(_1); 4 | function _1() { 5 | return M.chain(eff_1(), _2); 6 | } 7 | function _2() { 8 | return M.chain(eff_2(), _3); 9 | } 10 | function _3() {} 11 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test02-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | var b; 8 | b = a._i++; 9 | a._i = null; 10 | return M.chain(eff1(b), a_2); 11 | } 12 | function a_2(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test01-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | throw b; 11 | } 12 | function a_3(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test02-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | throw b; 11 | } 12 | function a_3(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test07-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a; 4 | return M.chain(eff(1), _1); 5 | function _1(b) { 6 | a = console.log(b, 2); 7 | return M.chain(eff(2), _2); 8 | } 9 | function _2(b) { 10 | a + b * 2; 11 | } 12 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test09-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a; 4 | return M.chain(eff(1), _1); 5 | function _1(b) { 6 | a = b; 7 | return M.chain(eff(2), _2); 8 | } 9 | function _2(b) { 10 | console.log(a + b, 2); 11 | } 12 | } -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepInPlain.js: -------------------------------------------------------------------------------- 1 | let i = 100, 2 | j = 20; 3 | function func1(j) { 4 | let k = i++; 5 | func2.call({ j, i }, k); 6 | 7 | function func2(m) { 8 | i += (m => this.j + m)(k); 9 | i *= 10 + this.i + m; 10 | } 11 | } 12 | func1(3000); 13 | console.log("I", i); 14 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/test2-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | // *- when it is the last statement 3 | (function () { 4 | return M.chain(eff(2), _1); 5 | function _1(a) { 6 | if (a) {} else { 7 | return M.chain(eff(3), _2); 8 | } 9 | } 10 | function _2() {} 11 | }); -------------------------------------------------------------------------------- /packages/core/test/samples/options/generators-out-f.js: -------------------------------------------------------------------------------- 1 | // *- DEFAULT 2 | import * as G from "@effectful/es"; 3 | var _c = G.generatorFunction(c); 4 | function c() { 5 | return G.scope(_1); 6 | function _1() { 7 | return G.yldStar(z, _2); 8 | } 9 | function _2() { 10 | return G.pure(); 11 | } 12 | } -------------------------------------------------------------------------------- /packages/es/test/generators.js: -------------------------------------------------------------------------------- 1 | const run = require("./templates/generators"); 2 | 3 | describe("generators using abstract context passing runtime", function() { 4 | run("with default options", require("./default/links/generators")); 5 | // run("with top level handlers",require("./topLevel/links/generators")) 6 | }); 7 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/with-try-stmt/test1-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | lab: { 3 | try { 4 | if (eff(1)) { 5 | eff("before break"); 6 | break lab; 7 | } 8 | eff(2); 9 | } catch (e) { 10 | eff(3); 11 | } 12 | eff(4); 13 | } 14 | eff(5); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/with-try-stmt/test4-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | lab: { 3 | try { 4 | eff(2); 5 | if (eff(3)) break lab; 6 | else throw new Error("error"); 7 | eff(4); 8 | } catch (e) { 9 | eff(5); 10 | } 11 | eff(6); 12 | } 13 | eff(7); 14 | }); 15 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test32-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a) { 10 | return M.chain(eff(2), a_3); 11 | } 12 | function a_3(a) {} -------------------------------------------------------------------------------- /packages/debugger/src/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "@babel/transform-typescript", 4 | ["@babel/transform-modules-commonjs", { "loose": true, "noInterop": true }], 5 | "@babel/transform-optional-chaining", 6 | "@babel/transform-spread", 7 | "@babel/transform-object-rest-spread" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /samples/persist-counters/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Persistent counters 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/react-do/jest.setup.js: -------------------------------------------------------------------------------- 1 | const realError = console.error; 2 | 3 | console.error = (...args) => { 4 | const msg = args[0]; 5 | if ( 6 | typeof msg === "string" && 7 | msg.includes("react-test-renderer is deprecated") 8 | ) { 9 | return; 10 | } 11 | realError.apply(console, args); 12 | }; 13 | -------------------------------------------------------------------------------- /packages/core/src/presets/defunct.js: -------------------------------------------------------------------------------- 1 | export default { 2 | defunct: true, 3 | defunctStateDiscriminant: "arg", 4 | scopeContext: true, 5 | scopePrefix: true, 6 | static: true, 7 | contextMethodOps: true, 8 | inlineRaiseOp: "throw", 9 | keepLastPure: true, 10 | keepLastRaise: true, 11 | par: true 12 | }; 13 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test50-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(test(1), _1); 4 | function _1(a) { 5 | if (a) { 6 | return M.chain(eff(3), _2); 7 | } else { 8 | return M.chain(eff(5), _2); 9 | } 10 | } 11 | function _2() {} 12 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test03-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(3), a_2); 8 | } 9 | function a_2(a, c) { 10 | var b; 11 | b = console.log(2 + c); 12 | 1 + b + 4; 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/profiles/test01-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a) { 10 | return M.chain(eff(2), a_3); 11 | } 12 | function a_3(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/profiles/test02-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function e() { 3 | var e = M.context(); 4 | return M.scope(e_1); 5 | } 6 | function e_1(e) { 7 | return M.chain(eff1(), e_2); 8 | } 9 | function e_2(e) { 10 | return M.chain(eff2(), e_3); 11 | } 12 | function e_3(e) {} -------------------------------------------------------------------------------- /packages/vscode-debugger/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "class-name": true, 7 | "semicolon": [ 8 | true, 9 | "always" 10 | ], 11 | "triple-equals": true 12 | }, 13 | "defaultSeverity": "warning" 14 | } 15 | -------------------------------------------------------------------------------- /samples/persist-counters/jest.setup.js: -------------------------------------------------------------------------------- 1 | const realError = console.error; 2 | 3 | console.error = (...args) => { 4 | const msg = args[0]; 5 | if ( 6 | typeof msg === "string" && 7 | msg.includes("react-test-renderer is deprecated") 8 | ) { 9 | return; 10 | } 11 | realError.apply(console, args); 12 | }; 13 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/test3-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | (function () { 3 | var ctx = M.context(); 4 | return M.scope(f_1); 5 | }); 6 | function f_1(ctx) { 7 | return M.chain(eff(2), f_2); 8 | } 9 | function f_2(ctx) { 10 | return M.chain(eff(4), f_3); 11 | } 12 | function f_3(ctx) {} -------------------------------------------------------------------------------- /packages/core/test/samples/for-stmt/body-eff/test2-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var i, j, d, len, ref; 3 | ref = [1, 2, 3]; 4 | for (i = 0, len = ref.lenght; i < len; i++) { 5 | for (j = 0, len = ref.length; j < len; j++) { 6 | d = ref[j]; 7 | eff(i); 8 | } 9 | eff(2); 10 | } 11 | eff(3); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test37-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | if (true) { 8 | 1 + 1; 9 | } 10 | return M.chain(M.pure(), a_2); 11 | } 12 | function a_2(a, b) { 13 | return b; 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/switch-stmt/test5-in.js: -------------------------------------------------------------------------------- 1 | // *- without EOB exits 2 | function b() { 3 | switch (eff(1)) { 4 | case 1: 5 | if (effB(1)) break; 6 | case 2: 7 | if (effB(2)) { 8 | break; 9 | } 10 | effB(3); 11 | break; 12 | default: 13 | eff(4); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/stepBackPlain.js: -------------------------------------------------------------------------------- 1 | let i = 100, 2 | j = 20; 3 | function func1(j) { 4 | let k = i++; 5 | func2.call({ j, i }, k); 6 | 7 | function func2(m) { 8 | i += (m => this.j + m)(k); 9 | i *= 10 + this.i + m; 10 | } 11 | } 12 | func1(3000); 13 | console.log("I", i); 14 | debugger; 15 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test11-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a; 4 | return M.chain(eff(1), _1); 5 | function _1(b) { 6 | a = b; 7 | return M.chain(eff(2), _2); 8 | } 9 | function _2(b) { 10 | return M.chain(a(b), _3); 11 | } 12 | function _3() {} 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test12-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a; 4 | return M.chain(eff(1), _1); 5 | function _1(b) { 6 | a = b; 7 | return M.chain(eff(2), _2); 8 | } 9 | function _2(b) { 10 | return M.chain(a(b), _3); 11 | } 12 | function _3() {} 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/switch-stmt/test10-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0; 3 | eff(); 4 | i += 1; 5 | switch ((i += 2)) { 6 | case 1: 7 | effB((i += 3)); 8 | break; 9 | case 2: 10 | effB(i); 11 | break; 12 | case 3: 13 | console.log("hi", i); 14 | } 15 | eff(i); 16 | } 17 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/asyncSteps.js: -------------------------------------------------------------------------------- 1 | async function there() { 2 | await doubleDelay(); 3 | console.log("A1"); 4 | await doubleDelay(); 5 | console.log("A2"); 6 | } 7 | 8 | async function doubleDelay() { 9 | await new Promise(i => setTimeout(i, 234)); 10 | await new Promise(i => setTimeout(i, 123)); 11 | } 12 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOverPlain.js: -------------------------------------------------------------------------------- 1 | let i = 0; 2 | const j = 1; 3 | function func1(m) { 4 | i += this.i + j + m; 5 | } 6 | function func2(j) { 7 | i += j; 8 | debugger; 9 | func1.apply({ i: j }, [30]); 10 | } 11 | func1.call({ i }, 10); 12 | func2(15); 13 | func1.call({ i: j }, 20); 14 | console.log("I", i); 15 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/spawn.js: -------------------------------------------------------------------------------- 1 | const cp = require("child_process"); 2 | 3 | cp.exec( 4 | `node ${__dirname}/child_process1`, 5 | { argv0: "child_process1" }, 6 | function(res, stdout) { 7 | console.log("EXIT MAIN", res, JSON.stringify(stdout)); 8 | cp.fork(`${__dirname}/child_process2`); 9 | } 10 | ); 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test60-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | return M.chain(read1(), _1); 5 | function _1(a) { 6 | i = a; 7 | return M.chain(eff(i), _2); 8 | } 9 | function _2() { 10 | return M.chain(write(i), _3); 11 | } 12 | function _3() {} 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test10-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a; 4 | return M.chain(eff(1), _1); 5 | function _1(b) { 6 | a = b; 7 | return M.chain(eff(2), _2); 8 | } 9 | function _2(b) { 10 | return M.chain(effC(a, b), _3); 11 | } 12 | function _3() {} 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test16-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a; 4 | return M.chain(eff(1), _1); 5 | function _1(b) { 6 | a = b; 7 | return M.chain(eff(2), _2); 8 | } 9 | function _2(b) { 10 | return M.chain(a(b + 2), _3); 11 | } 12 | function _3() {} 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test21-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var _this = this; 4 | return M.chain(eff(1), _1); 5 | function _1() { 6 | return M.chain(_this.eff(2), _2); 7 | } 8 | function _2() { 9 | return M.chain(eff3(_this), _3); 10 | } 11 | function _3() {} 12 | } -------------------------------------------------------------------------------- /packages/core/test/samples/options/newtarget-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a1(a) { 3 | this.a = a; 4 | } 5 | function b() { 6 | var b = M.context(this, new.target); 7 | return M.scope(b_1); 8 | } 9 | function b_1(b) { 10 | var a; 11 | a = a1; 12 | return M.chain(a(), b_2); 13 | } 14 | function b_2(b) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test19-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a, r; 4 | return M.chain(eff("1"), _1); 5 | function _1(b) { 6 | a = b; 7 | return M.chain(eff(2), _2); 8 | } 9 | function _2(b) { 10 | console.log(a, b, 3); 11 | return console.log("4"); 12 | } 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/options/props-get.opts: -------------------------------------------------------------------------------- 1 | { 2 | "normalizeAssign": true, 3 | "optimizeContextVars": false, 4 | "wrapPropAccess": { 5 | "get": { "name": "G", "bind": false, "locals": false }, 6 | "call": { "name": "C", "bind": false, "wrapArr":true }, 7 | "constr": {"name": "N", "bind": false, "wrapArr":true} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test43-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var r; 4 | return M.chain(eff1(), _1); 5 | function _1() { 6 | if (a) { 7 | return 5; 8 | } else { 9 | return M.chain(eff6(), _2); 10 | } 11 | } 12 | function _2() { 13 | return r; 14 | } 15 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test05-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(effb(2), a_2); 8 | } 9 | function a_2(a, b) { 10 | return M.chain(eff(b), a_3); 11 | } 12 | function a_3(a, b) { 13 | b + 2; 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test18-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff("1"), a_2); 8 | } 9 | function a_2(a, b) { 10 | console.log(b, 3); 11 | console.log("2"); 12 | return console.log("3"); 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/switch-stmt/test9-in.js: -------------------------------------------------------------------------------- 1 | // *- with state 2 | function a() { 3 | var i = 0; 4 | eff(); 5 | switch (eff((i += 1))) { 6 | case 1: 7 | effB((i += 3)); 8 | break; 9 | case 2: 10 | effB((i += 5)); 11 | break; 12 | case 3: 13 | console.log("hi", i); 14 | } 15 | eff(i); 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test53-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | var i; 8 | i = 0; 9 | return M.chain(eff2(2), a_2); 10 | } 11 | function a_2(a, b) { 12 | return M.chain(eff1(b), a_3); 13 | } 14 | function a_3(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test57-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | var i; 8 | i = 0; 9 | return M.chain(eff2(2), a_2); 10 | } 11 | function a_2(a, b) { 12 | return M.chain(eff1(b), a_3); 13 | } 14 | function a_3(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test59-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | return M.chain(read1(), _1); 6 | function _1(a) { 7 | i = a; 8 | return M.chain(eff(i), _2); 9 | } 10 | function _2() { 11 | return M.chain(write(i), _3); 12 | } 13 | function _3() {} 14 | } -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/reverseContinuePlain.js: -------------------------------------------------------------------------------- 1 | let i = 100, 2 | j = 20; 3 | function func1(j) { 4 | let k = i++; 5 | func2.call({ j, i }, k); 6 | 7 | function func2(m) { 8 | i += (m => this.j + m)(k); 9 | debugger; 10 | i *= 10 + this.i + m; 11 | } 12 | } 13 | func1(3000); 14 | console.log("I", i); 15 | debugger; 16 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/programWithException.js: -------------------------------------------------------------------------------- 1 | console.log("line 1"); 2 | console.log("line 2"); 3 | console.log("line 3"); 4 | 5 | try { 6 | throw new Error("error"); 7 | } catch(e) { 8 | console.log("exception: " + e); 9 | } 10 | 11 | console.log("line 4"); 12 | console.foobar("line 5"); 13 | console.log("line 6"); 14 | -------------------------------------------------------------------------------- /packages/core-loose/test/samples/options/props-get.opts: -------------------------------------------------------------------------------- 1 | { 2 | "normalizeAssign": true, 3 | "optimizeContextVars": false, 4 | "wrapPropAccess": { 5 | "get": { "name": "G", "bind": false, "locals": false }, 6 | "call": { "name": "C", "bind": false, "wrapArr":true }, 7 | "constr": {"name": "N", "bind": false, "wrapArr":true} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/for-stmt/it-has-continue-stmt/test1-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var i, j, len, ref; 3 | ref = [1, 2, 3]; 4 | lab: for (i = 0; i < 3; i++) { 5 | eff(i); 6 | for (j = 0, len = ref.length; j < len; j++) { 7 | d = ref[j]; 8 | if (eff(d)) continue; 9 | if (eff(2)) continue lab; 10 | } 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /packages/core/test/samples/for-stmt/last/it-has-break-stmt/with-label-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var i, j, len, ref; 3 | ref = [1, 2, 3]; 4 | lab: for (i = 0; i < 3; i++) { 5 | eff(i); 6 | for (j = 0, len = ref.length; j < len; j++) { 7 | d = ref[j]; 8 | if (eff(d)) break; 9 | if (eff(2)) break lab; 10 | } 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/test1-out-ft.js: -------------------------------------------------------------------------------- 1 | var Z = require("@effectful/generators"); 2 | function a() { 3 | var a = Z.generator(); 4 | return Z.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return Z.yld(1, a_2); 8 | } 9 | function a_2(a) { 10 | return Z.yld(2, a_3); 11 | } 12 | function a_3(a) { 13 | return Z.pure(); 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/test1-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/generators"; 2 | function a() { 3 | var a = M.generator(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.yld(1, a_2); 8 | } 9 | function a_2(a) { 10 | return M.yld(2, a_3); 11 | } 12 | function a_3(a) { 13 | return M.pure(); 14 | } -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/generatorStep.js: -------------------------------------------------------------------------------- 1 | function* gen1() { 2 | yield "A"; 3 | yield "B"; 4 | } 5 | 6 | function* gen2() { 7 | let cnt = 0; 8 | yield* gen1(); 9 | for (const i of gen1()) yield `${i}.${cnt++}`; 10 | } 11 | 12 | function iter() { 13 | for (const i of gc) { 14 | console.log("G", i); 15 | } 16 | } 17 | iter(); 18 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/programWithFunction.js: -------------------------------------------------------------------------------- 1 | 2 | // global function 3 | foo = function(n) { 4 | return n; 5 | } 6 | 7 | bar = function(n) { 8 | return n; 9 | } 10 | 11 | console.log('foo defined'); 12 | 13 | setInterval(function() { 14 | foo(123); 15 | }, 300); 16 | 17 | setInterval(function() { 18 | bar(123); 19 | }, 300); -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-detect/with-import/test1-out-ft.js: -------------------------------------------------------------------------------- 1 | import Z from "@effectful/generators"; 2 | function a() { 3 | var a = Z.generator(); 4 | return Z.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return Z.yld(1, a_2); 8 | } 9 | function a_2(a) { 10 | return Z.yld(2, a_3); 11 | } 12 | function a_3(a) { 13 | return Z.pure(); 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-es6-import/test1-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as Z from "@effectful/generators"; 2 | function a() { 3 | var a = Z.generator(); 4 | return Z.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return Z.yld(1, a_2); 8 | } 9 | function a_2(a) { 10 | return Z.yld(2, a_3); 11 | } 12 | function a_3(a) { 13 | return Z.pure(); 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test20-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var r; 4 | return M.chain(eff("1"), _1); 5 | function _1(a) { 6 | console.log(a, 3); 7 | console.log("2"); 8 | console.log("3"); 9 | return M.chain(eff(2), _2); 10 | } 11 | function _2(a) { 12 | return a; 13 | } 14 | } -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/evalDir.js: -------------------------------------------------------------------------------- 1 | let i = 2; 2 | global.i = 1; 3 | global.obj = "there"; 4 | function dirEvalFunc(k) { 5 | return eval(` 6 | debugger; 7 | for(let j = 0; j < 4; j+=1) { 8 | console.log("I",j,k,i,this.obj); 9 | i++; 10 | } 11 | `); 12 | } 13 | dirEvalFunc(2); 14 | dirEvalFunc.call({ obj: "hi" }, 1); 15 | console.log(i,global.i); 16 | -------------------------------------------------------------------------------- /packages/js/babel-plugin-transform.js: -------------------------------------------------------------------------------- 1 | const Transform = require("@effectful/core/v2/presets/debugger").default; 2 | const { babelPlugin } = require("@effectful/core/v2/compiler"); 3 | 4 | module.exports = babelPlugin(Transform).config({ 5 | timeTravel: false, 6 | blackbox: true, 7 | loopsSubScopes: "always", 8 | rt: "@effectful/debugger/apiMin" 9 | }); 10 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test15-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | i++; 6 | return M.chain(eff1(i), _1); 7 | function _1() { 8 | if (t) { 9 | return M.chain(eff2(i), _2); 10 | } else { 11 | return M.chain(eff3(i), _2); 12 | } 13 | } 14 | function _2() {} 15 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test31-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0, 3 | j = 0; 4 | eff1(i, j); 5 | i++, j++; 6 | (function b(i, k) { 7 | var z = 0; 8 | eff2(i, j, k, z); 9 | i++, j++, k++, z++; 10 | eff3(i, j, k, z); 11 | eff4(i, j, k, z); 12 | })(i, j); 13 | i++, j++; 14 | eff5(i, j); 15 | eff6(i, j); 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test15-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a; 4 | return M.chain(effb(2), _1); 5 | function _1(a) { 6 | return M.chain(eff(a), _2); 7 | } 8 | function _2(b) { 9 | a = b; 10 | return M.chain(effc(3), _3); 11 | } 12 | function _3(b) { 13 | 5 + a + b; 14 | } 15 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test17-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a; 4 | return M.chain(effc(3), _1); 5 | function _1(b) { 6 | a = b; 7 | return M.chain(effb(2), _2); 8 | } 9 | function _2(a) { 10 | return M.chain(eff(a + 4), _3); 11 | } 12 | function _3(b) { 13 | 5 + a + b; 14 | } 15 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/profiles/test03-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(p1(), _1); 4 | function _1() { 5 | return M.chain(p2(), _2); 6 | } 7 | function _2() { 8 | return M.chain(e1(), _3); 9 | } 10 | function _3() { 11 | return M.chain(e(2), _4); 12 | } 13 | function _4() {} 14 | } -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/evalDir.js: -------------------------------------------------------------------------------- 1 | let i = 2; 2 | global.i = 1; 3 | global.obj = "there"; 4 | function dirEvalFunc(k) { 5 | return eval(` 6 | debugger; 7 | for(let j = 0; j < 4; j+=1) { 8 | console.log("I",j,k,i,this.obj); 9 | i++; 10 | } 11 | `); 12 | } 13 | dirEvalFunc(2); 14 | dirEvalFunc.call({ obj: "hi" }, 1); 15 | console.log(i,global.i); 16 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/with-try-stmt/test2-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | // *- when it is the last statement 3 | (function () { 4 | var ctx = M.context(); 5 | return M.scope(f_2); 6 | }); 7 | function f_1(ctx) { 8 | var e; 9 | e = ctx._ex; 10 | ctx._ex = null; 11 | return M.chain(eff(3), f_2); 12 | } 13 | function f_2(ctx) {} -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/test1-out-f.js: -------------------------------------------------------------------------------- 1 | var Z = require("@effectful/generators"); 2 | var _a = Z.generatorFunction(a); 3 | function a() { 4 | return Z.scope(_1); 5 | function _1() { 6 | return Z.yld(1, _2); 7 | } 8 | function _2() { 9 | return Z.yld(2, _3); 10 | } 11 | function _3() { 12 | return Z.pure(); 13 | } 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/options/initial-scope-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function scope() { 3 | var scope = M.context(); 4 | return M.otherScope(scope_1); 5 | } 6 | function scope_1(scope) { 7 | return M.chain(eff_1(), scope_2); 8 | } 9 | function scope_2(scope) { 10 | return M.chain(eff_2(), scope_3); 11 | } 12 | function scope_3(scope) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test47-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | a._i = 0; 8 | return M.chain(eff(1), a_2); 9 | } 10 | function a_2(a) { 11 | a._i++; 12 | a._i = null; 13 | return M.chain(eff(2), a_3); 14 | } 15 | function a_3(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test54-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | a._i = 0; 8 | return M.chain(eff(1), a_2); 9 | } 10 | function a_2(a) { 11 | a._i++; 12 | a._i = null; 13 | return M.chain(eff(2), a_3); 14 | } 15 | function a_3(a) {} -------------------------------------------------------------------------------- /packages/debugger/config/targetResolve.js: -------------------------------------------------------------------------------- 1 | const config = require("./deriveConfig"); 2 | 3 | function targetResolve(request) { 4 | return require.resolve(request, { paths: [config.srcRoot] }); 5 | } 6 | 7 | exports.targetResolve = targetResolve; 8 | 9 | exports.targetRequire = function targetRequire(request) { 10 | return require(targetResolve(request)); 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/program.js: -------------------------------------------------------------------------------- 1 | var a = []; 2 | a.push("line 1"); 3 | a.push("line 2"); 4 | a.push("line 3"); 5 | a.push("line 4"); 6 | a.push("line 5"); 7 | a.push("line 6"); 8 | 9 | var x = 0; 10 | 11 | for (var i = 0; i < a.length; i++) { 12 | x = i*i; 13 | console.log(x); 14 | } 15 | 16 | process.exit(); // ensure that program terminates -------------------------------------------------------------------------------- /packages/core-loose/test/samples/options/eval.opts: -------------------------------------------------------------------------------- 1 | { 2 | "contextState": true, 3 | "closureShortcuts": false, 4 | "closureStorageField": "C", 5 | "varStorageField": "V", 6 | "evalCtx": { 7 | "a": ["_a", 0], 8 | "b": ["_b", 1], 9 | "c": ["_c", 2] 10 | }, 11 | "contextMethodOps":true, 12 | "injectEvalCtx":true, 13 | "injectFuncMeta": "meta" 14 | } 15 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/with-assign/test1-out-ft.js: -------------------------------------------------------------------------------- 1 | var Z; 2 | Z = require("@effectful/generators"); 3 | function a() { 4 | var a = Z.generator(); 5 | return Z.scope(a_1); 6 | } 7 | function a_1(a) { 8 | return Z.yld(1, a_2); 9 | } 10 | function a_2(a) { 11 | return Z.yld(2, a_3); 12 | } 13 | function a_3(a) { 14 | return Z.pure(); 15 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/with-conflict/test1-out-ft.js: -------------------------------------------------------------------------------- 1 | var _M = require("@effectful/generators"); 2 | function M() { 3 | var M = _M.generator(); 4 | return _M.scope(M_1); 5 | } 6 | function M_1(M) { 7 | return _M.yld(1, M_2); 8 | } 9 | function M_2(M) { 10 | return _M.yld(2, M_3); 11 | } 12 | function M_3(M) { 13 | return _M.pure(); 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-detect/with-import/test1-out-f.js: -------------------------------------------------------------------------------- 1 | import Z from "@effectful/generators"; 2 | var _a = Z.generatorFunction(a); 3 | function a() { 4 | return Z.scope(_1); 5 | function _1() { 6 | return Z.yld(1, _2); 7 | } 8 | function _2() { 9 | return Z.yld(2, _3); 10 | } 11 | function _3() { 12 | return Z.pure(); 13 | } 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-es6-import/test1-out-f.js: -------------------------------------------------------------------------------- 1 | import * as Z from "@effectful/generators"; 2 | var _a = Z.generatorFunction(a); 3 | function a() { 4 | return Z.scope(_1); 5 | function _1() { 6 | return Z.yld(1, _2); 7 | } 8 | function _2() { 9 | return Z.yld(2, _3); 10 | } 11 | function _3() { 12 | return Z.pure(); 13 | } 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-es6-import/with-import-default/test1-out-ft.js: -------------------------------------------------------------------------------- 1 | import Z from "@effectful/generators"; 2 | function a() { 3 | var a = Z.generator(); 4 | return Z.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return Z.yld(1, a_2); 8 | } 9 | function a_2(a) { 10 | return Z.yld(2, a_3); 11 | } 12 | function a_3(a) { 13 | return Z.pure(); 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/test1-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/generators"; 2 | var _a = M.generatorFunction(a); 3 | function a() { 4 | return M.scope(_1); 5 | function _1() { 6 | return M.yld(1, _2); 7 | } 8 | function _2() { 9 | return M.yld(2, _3); 10 | } 11 | function _3() { 12 | return M.pure(); 13 | } 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/with-commonjs-target/test1-out-ft.js: -------------------------------------------------------------------------------- 1 | var M = require("@effectful/generators"); 2 | function a() { 3 | var a = M.generator(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.yld(1, a_2); 8 | } 9 | function a_2(a) { 10 | return M.yld(2, a_3); 11 | } 12 | function a_3(a) { 13 | return M.pure(); 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test04-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function e() { 3 | var e = M.context(); 4 | return M.scope(e_1); 5 | } 6 | function e_1(e) { 7 | return M.chain(eff(1), e_2); 8 | } 9 | function e_2(e, a) { 10 | e._ = a; 11 | return M.chain(eff(2), e_3); 12 | } 13 | function e_3(e, a) { 14 | console.log(e._ + a); 15 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test08-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | a._ = b; 11 | return M.chain(eff(2), a_3); 12 | } 13 | function a_3(a, b) { 14 | console.log(a._, b, 2); 15 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test09-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | a._ = b; 11 | return M.chain(eff(2), a_3); 12 | } 13 | function a_3(a, b) { 14 | console.log(a._ + b, 2); 15 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/profiles/test05-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | M.profile("defaultFull"); 3 | p1(); 4 | p2(); 5 | function a() { 6 | console.log("hi"); 7 | e1(); 8 | e2(); 9 | } 10 | M.profile("defaultMinimal"); 11 | p2(); 12 | p3(); 13 | function b() { 14 | p4(); 15 | p5(); 16 | M(e1()); 17 | M(e(2)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/evalIndir.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | let i = 2; 3 | global.i = 1; 4 | global.obj = "there"; 5 | global.k = 1; 6 | function a(k) { 7 | return (0, eval)(` 8 | debugger; 9 | for(let j = 0; j < 4; j++) { 10 | console.log("I",j,i,k,this.obj); 11 | i++; 12 | } 13 | `); 14 | } 15 | a(3); 16 | a.call({ obj: "hi" }, 2); 17 | console.log(i,global.i); 18 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepInGenerator.js: -------------------------------------------------------------------------------- 1 | let i = 100, 2 | j = 20; 3 | function* gfunc1(j) { 4 | let k = i++; 5 | yield* gfunc2.call({ j, i }, k); 6 | function* gfunc2(m) { 7 | yield (m => this.j + m)(k); 8 | i *= 10 + this.i + m; 9 | } 10 | } 11 | for (const i of gfunc1(3000)) { 12 | console.log("I:", i); 13 | } 14 | console.log("END:", i); 15 | -------------------------------------------------------------------------------- /samples/persist-boxes/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * combining all the steps, more a kind of a configuration file 3 | */ 4 | 5 | import * as D from "./draw"; 6 | import * as S from "./state"; 7 | import { run, render } from "./kit"; 8 | 9 | run( 10 | D.rootContainer, 11 | D.animateDelete({}), 12 | D.insertBox, 13 | D.collectBoxes, 14 | S.saveLocal, 15 | render(root) 16 | ); 17 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/minimal-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | eff(1); 4 | eff(2); 5 | return eff(3); 6 | } 7 | function b() { 8 | var r; 9 | eff(1); 10 | return M.chain(eff(2), _1); 11 | function _1() { 12 | eff(3); 13 | return M.chain(eff(4), _2); 14 | } 15 | function _2() { 16 | return 5; 17 | } 18 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test16-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | i++; 6 | return M.chain(eff1(i), _1); 7 | function _1() { 8 | return M.chain(eff(i), _2); 9 | } 10 | function _2() { 11 | { 12 | i++; 13 | } 14 | return M.chain(eff2(i), _3); 15 | } 16 | function _3() {} 17 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test07-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | a._ = console.log(b, 2); 11 | return M.chain(eff(2), a_3); 12 | } 13 | function a_3(a, b) { 14 | a._ + b * 2; 15 | } -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/evalIndir.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | let i = 2; 3 | global.i = 1; 4 | global.obj = "there"; 5 | global.k = 1; 6 | function a(k) { 7 | return (0, eval)(` 8 | debugger; 9 | for(let j = 0; j < 4; j++) { 10 | console.log("I",j,i,k,this.obj); 11 | i++; 12 | } 13 | `); 14 | } 15 | a(3); 16 | a.call({ obj: "hi" }, 2); 17 | console.log(i,global.i); 18 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/stepBackGenerator.js: -------------------------------------------------------------------------------- 1 | let i = 100, 2 | j = 20; 3 | function* gfunc1(j) { 4 | let k = i++; 5 | yield* gfunc2.call({ j, i }, k); 6 | function* gfunc2(m) { 7 | yield (m => this.j + m)(k); 8 | i *= 10 + this.i + m; 9 | } 10 | } 11 | for (const i of gfunc1(3000)) { 12 | console.log("I:", i); 13 | } 14 | console.log("END:", i); 15 | -------------------------------------------------------------------------------- /packages/es/test/default/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "sourceType": "script", 3 | "plugins": [["../../transform", 4 | {"topLevel":false, 5 | "defunct":true, 6 | "contextState":true, 7 | "contextBy":"this", 8 | "generators": {"bodyCommentHack":"regenerator"}, 9 | "modules":"commonjs"}]] 10 | } 11 | 12 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/tt/reverseContinueGenerator.js: -------------------------------------------------------------------------------- 1 | let i = 100, 2 | j = 20; 3 | function* gfunc1(j) { 4 | let k = i++; 5 | yield* gfunc2.call({ j, i }, k); 6 | function* gfunc2(m) { 7 | yield (m => this.j + m)(k); 8 | i *= 10 + this.i + m; 9 | } 10 | } 11 | for (const i of gfunc1(3000)) { 12 | console.log("I:", i); 13 | } 14 | console.log("END:", i); 15 | -------------------------------------------------------------------------------- /packages/es-inline/test/loose/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "sourceType": "script", 3 | "plugins": [["../../transform", 4 | {"topLevel":false, 5 | "defunct":true, 6 | "loose":true, 7 | "modules":"commonjs", 8 | "generators": {"bodyCommentHack":"regenerator"}, 9 | "all":{"removeAsserts":false}}]] 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/test4-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | (function () { 3 | var ctx = M.context(); 4 | return M.scope(f_1); 5 | }); 6 | function f_1(ctx) { 7 | return M.chain(eff(1), f_2); 8 | } 9 | function f_2(ctx) { 10 | return M.chain(eff(3), f_3); 11 | } 12 | function f_3(ctx) { 13 | return M.chain(eff(4), f_4); 14 | } 15 | function f_4(ctx) {} -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/with-assign/test1-out-f.js: -------------------------------------------------------------------------------- 1 | var Z; 2 | Z = require("@effectful/generators"); 3 | var _a = Z.generatorFunction(a); 4 | function a() { 5 | return Z.scope(_1); 6 | function _1() { 7 | return Z.yld(1, _2); 8 | } 9 | function _2() { 10 | return Z.yld(2, _3); 11 | } 12 | function _3() { 13 | return Z.pure(); 14 | } 15 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-commonjs/with-conflict/test1-out-f.js: -------------------------------------------------------------------------------- 1 | var _M = require("@effectful/generators"); 2 | var M1 = _M.generatorFunction(M); 3 | function M() { 4 | return _M.scope(_1); 5 | function _1() { 6 | return _M.yld(1, _2); 7 | } 8 | function _2() { 9 | return _M.yld(2, _3); 10 | } 11 | function _3() { 12 | return _M.pure(); 13 | } 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/with-es6-import/with-import-default/test1-out-f.js: -------------------------------------------------------------------------------- 1 | import Z from "@effectful/generators"; 2 | var _a = Z.generatorFunction(a); 3 | function a() { 4 | return Z.scope(_1); 5 | function _1() { 6 | return Z.yld(1, _2); 7 | } 8 | function _2() { 9 | return Z.yld(2, _3); 10 | } 11 | function _3() { 12 | return Z.pure(); 13 | } 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/with-commonjs-target/test1-out-f.js: -------------------------------------------------------------------------------- 1 | var M = require("@effectful/generators"); 2 | var _a = M.generatorFunction(a); 3 | function a() { 4 | return M.scope(_1); 5 | function _1() { 6 | return M.yld(1, _2); 7 | } 8 | function _2() { 9 | return M.yld(2, _3); 10 | } 11 | function _3() { 12 | return M.pure(); 13 | } 14 | } -------------------------------------------------------------------------------- /packages/core/test/samples/switch-stmt/test8-in.js: -------------------------------------------------------------------------------- 1 | // *- with state 2 | function a() { 3 | var i = 0; 4 | eff(); 5 | switch (eff((i += 1))) { 6 | case check((i += 2)): 7 | effB((i += 3)); 8 | break; 9 | case check((i += 4)): 10 | effB((i += 5)); 11 | break; 12 | case check((i += 6)): 13 | console.log("hi", i); 14 | } 15 | eff(i); 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/babel/ts-no-consts.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @babel/plugin-transform-typescript doesn't support const enums, 3 | * but for debugging purposes we can ignore this 4 | */ 5 | module.exports = function() { 6 | return { 7 | name: "@effectful/core/ts-no-const", 8 | visitor: { 9 | TSEnumDeclaration(path) { 10 | path.node.const = false; 11 | } 12 | } 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /packages/core/test/samples/if-stmt/condition-eff-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | // *- when branches are pure but its condition has effects 3 | // *- should bind statement's condition part using fmap 4 | function a() { 5 | return M.chain(eff(1), _1); 6 | function _1(a) { 7 | if (a) { 8 | console.log(1); 9 | } else { 10 | console.log(2); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/with-name-conflict/test1-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as _M from "@effectful/generators"; 2 | var M = 10; 3 | function a() { 4 | var a = _M.generator(); 5 | return _M.scope(a_1); 6 | } 7 | function a_1(a) { 8 | return _M.yld(1, a_2); 9 | } 10 | function a_2(a) { 11 | return _M.yld(2, a_3); 12 | } 13 | function a_3(a) { 14 | return _M.pure(); 15 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test17-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | a._i = 0; 8 | return M.chain(eff1(a._i), a_2); 9 | } 10 | function a_2(a) { 11 | var b; 12 | a._i++; 13 | b = a._i, a._i = null; 14 | return M.chain(eff2(b), a_3); 15 | } 16 | function a_3(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test34-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(eff(1), _1); 4 | function _1() { 5 | return M.chain(eff(2), _2); 6 | } 7 | function _2(a) { 8 | if (a) { 9 | return M.chain(eff3(), _3); 10 | } 11 | } 12 | function _3() { 13 | return M.chain(eff4(), _4); 14 | } 15 | function _4() {} 16 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test50-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(test(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | if (b) { 11 | return M.chain(eff(3), a_3); 12 | } else { 13 | return M.chain(eff(5), a_3); 14 | } 15 | } 16 | function a_3(a) {} -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOutGenerator.js: -------------------------------------------------------------------------------- 1 | function* func0() { 2 | yield 1; 3 | debugger; 4 | yield 2; 5 | } 6 | 7 | function* func1() { 8 | yield* func0(); 9 | for (const i of func0()) { 10 | yield i; 11 | } 12 | } 13 | 14 | function* func2() { 15 | yield* func1(); 16 | for (const i of func1()) yield i; 17 | } 18 | 19 | for (const i of func2()) console.log("I", i); 20 | -------------------------------------------------------------------------------- /packages/vscode-debugger/testdata/vscode-node-debug/folder with spaces/file with spaces.js: -------------------------------------------------------------------------------- 1 | var a = []; 2 | a.push("line 1"); 3 | a.push("line 2"); 4 | a.push("line 3"); 5 | a.push("line 4"); 6 | a.push("line 5"); 7 | a.push("line 6"); 8 | 9 | var x = 0; 10 | 11 | for (var i = 0; i < a.length; i++) { 12 | x = i*i; 13 | console.log(x); 14 | } 15 | 16 | process.exit(); // ensure that program terminates -------------------------------------------------------------------------------- /samples/persist-boxes/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: { 3 | index: "./main.js" 4 | }, 5 | mode: process.env.WEBPACK_SERVE ? "development" : "production", 6 | module: { 7 | rules: [ 8 | { 9 | test: /\.js$/, 10 | exclude: /node_modules/, 11 | use: { 12 | loader: "babel-loader" 13 | } 14 | } 15 | ] 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /packages/core/test/samples/break-stmt/test2-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | // *- when it is the last statement 3 | (function () { 4 | var ctx = M.context(); 5 | return M.scope(f_1); 6 | }); 7 | function f_1(ctx) { 8 | return M.chain(eff(2), f_2); 9 | } 10 | function f_2(ctx, a) { 11 | if (a) {} else { 12 | return M.chain(eff(3), f_3); 13 | } 14 | } 15 | function f_3(ctx) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test24-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | var b; 8 | b = a._i++; 9 | return M.chain(eff1(b), a_2); 10 | } 11 | function a_2(a) { 12 | var b; 13 | b = a._i++; 14 | a._i = null; 15 | return M.chain(eff2(b), a_3); 16 | } 17 | function a_3(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/switch-stmt/test6-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | // *- without default branch 3 | function a() { 4 | return M.chain(eff(1), _1); 5 | function _1(a) { 6 | switch (a) { 7 | case 1: 8 | return M.chain(effB(1), _2); 9 | case 2: 10 | return M.chain(effB(2), _2); 11 | default: 12 | } 13 | } 14 | function _2() {} 15 | } -------------------------------------------------------------------------------- /samples/persist-counters/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: { 3 | index: "./main.js" 4 | }, 5 | mode: process.env.WEBPACK_SERVE ? "development" : "production", 6 | module: { 7 | rules: [ 8 | { 9 | test: /\.js$/, 10 | exclude: /node_modules/, 11 | use: { 12 | loader: "babel-loader" 13 | } 14 | } 15 | ] 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /packages/core/test/samples/if-stmt/all-eff-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var r; 4 | return M.chain(eff(1), _1); 5 | function _1(a) { 6 | if (a) { 7 | return M.chain(eff(2), _2); 8 | } else { 9 | return M.chain(eff(3), _3); 10 | } 11 | } 12 | function _2(a) { 13 | return a; 14 | } 15 | function _3(a) { 16 | return a; 17 | } 18 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test43-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var _a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(_a) { 7 | return M.chain(eff1(), a_2); 8 | } 9 | function a_2(_a) { 10 | if (a) { 11 | return 5; 12 | } else { 13 | return M.chain(eff6(), a_3); 14 | } 15 | } 16 | function a_3(_a) { 17 | return _a._r; 18 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test19-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff("1"), a_2); 8 | } 9 | function a_2(a, b) { 10 | a._ = b; 11 | return M.chain(eff(2), a_3); 12 | } 13 | function a_3(a, b) { 14 | console.log(a._, b, 3); 15 | return console.log("4"); 16 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test07-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var i = 0, 3 | j = 0, 4 | k = 0; 5 | eff(i, j, k); 6 | for (;;) { 7 | eff1(i); 8 | for (;;) { 9 | k = 10; 10 | eff2(); 11 | for (;;) { 12 | eff4(k, j); 13 | } 14 | for (;;) { 15 | (i = 20), (j = 30), (k = 40); 16 | eff5(); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/core/test/samples/switch-stmt/test3-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(eff(1), _1); 4 | function _1(a) { 5 | switch (a) { 6 | case 1: 7 | return M.chain(effB(1), _2); 8 | case 2: 9 | return M.chain(effB(2), _2); 10 | default: 11 | return M.chain(effB(3), _2); 12 | } 13 | } 14 | function _2() {} 15 | } -------------------------------------------------------------------------------- /packages/debugger/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | src 3 | /test 4 | .tern* 5 | .babelrc 6 | .DS_Store 7 | .git 8 | tmp-* 9 | *.orig 10 | *.log 11 | *~ 12 | *.map 13 | npm-debug.log 14 | .gitignore 15 | .env 16 | .eslintrc 17 | .eslintignore 18 | *.test.js 19 | __fixtures__ 20 | __snapshots__ 21 | src 22 | /buildDeps.js 23 | jest.config.js 24 | api 25 | /core-js*.js 26 | /deps-index-template.js 27 | /polyfills.js 28 | -------------------------------------------------------------------------------- /packages/es/.env-cmdrc: -------------------------------------------------------------------------------- 1 | { 2 | "default": { 3 | "EJS_LEAN_METHOD_ITERATORS": "1" 4 | }, 5 | "defunct": { 6 | "EJS_DEFUNCT": "1" 7 | }, 8 | "inline": { 9 | "EJS_INLINE": "1" 10 | }, 11 | "loose": { 12 | "EJS_LEAN_METHOD_ITERATORS": "1", 13 | "EJS_NO_ES_OBJECT_MODEL": "1", 14 | "EJS_NO_ES_CHECK_GENERATOR_RUNNING": "1", 15 | "EJS_LEAN_METHOD_ITERATORS": "1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/es/test/topLevel/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "sourceType": "script", 3 | "plugins": [["../../transform", 4 | { 5 | "topLevel":true, 6 | "defunct":true, 7 | "contextState":true, 8 | "contextBy":"this", 9 | "generators": {"bodyCommentHack":"regenerator"}, 10 | "modules":"commonjs"}]] 11 | } 12 | 13 | -------------------------------------------------------------------------------- /packages/vscode-debugger/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": ["es6","dom"], 7 | "sourceMap": true, 8 | "rootDir": "src", 9 | "noImplicitAny": false, 10 | "strict": true /* enable all strict type-checking options */ 11 | }, 12 | "exclude": ["node_modules", ".vscode-test", "testdata"] 13 | } 14 | -------------------------------------------------------------------------------- /packages/core/test/samples/inject-runtime/without-import/with-name-conflict/test1-out-f.js: -------------------------------------------------------------------------------- 1 | import * as _M from "@effectful/generators"; 2 | var _a = _M.generatorFunction(a); 3 | var M = 10; 4 | function a() { 5 | return _M.scope(_1); 6 | function _1() { 7 | return _M.yld(1, _2); 8 | } 9 | function _2() { 10 | return _M.yld(2, _3); 11 | } 12 | function _3() { 13 | return _M.pure(); 14 | } 15 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test44-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var r; 4 | return M.chain(eff1(), _1); 5 | function _1() { 6 | if (a) { 7 | return M.chain(eff5(5), _2); 8 | } else { 9 | return M.chain(eff6(), _3); 10 | } 11 | } 12 | function _2(a) { 13 | return a; 14 | } 15 | function _3() { 16 | return r; 17 | } 18 | } -------------------------------------------------------------------------------- /packages/debugger/config/babel/ts-no-consts.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @babel/plugin-transform-typescript doesn't support const enums, 3 | * but for debugging purposes we can ignore this 4 | */ 5 | module.exports = function() { 6 | return { 7 | name: "@effectful/debugger/ts-no-const", 8 | visitor: { 9 | TSEnumDeclaration(path) { 10 | path.node.const = false; 11 | } 12 | } 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /packages/debugger/config/node/reloadWorker.js: -------------------------------------------------------------------------------- 1 | "no-ctrl"; 2 | const { parentPort, workerData } = require("worker_threads"); 3 | const fs = require("fs"); 4 | const status = new Int32Array(workerData); 5 | parentPort.on("message", function(filename) { 6 | fs.watch(filename, { persistent: false, encoding: "utf-8" }, type => { 7 | ++status[0]; 8 | parentPort.postMessage({ type, filename }); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/stepOutPlain.js: -------------------------------------------------------------------------------- 1 | let i = 0; 2 | function func0() { 3 | i++; 4 | } 5 | function func1() { 6 | func0(); 7 | debugger; 8 | func0(); 9 | } 10 | 11 | function func2() { 12 | func1(); 13 | func1(); 14 | } 15 | 16 | function func3() { 17 | (function sub() { 18 | func2(); 19 | })(); 20 | func1(); 21 | func0(); 22 | } 23 | 24 | func3(); 25 | console.log("I", i); 26 | -------------------------------------------------------------------------------- /packages/es-inline/test/generators.js: -------------------------------------------------------------------------------- 1 | const run = require("../../es/test/templates/generators"); 2 | require("../../es/test/kit/skip")(); 3 | 4 | describe("full inlined generators", function() { 5 | run("with default options", require("./default/links/generators")); 6 | }); 7 | 8 | describe("loose inlined generators", function() { 9 | run("with default options", require("./loose/links/generators")); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/core/test/samples/for-stmt/it-has-break-stmt/with-label/test1-in.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var i, j, len, ref; 3 | ref = [1, 2, 3]; 4 | lab: for (i = 0; i < 3; i++) { 5 | eff(i); 6 | for (j = 0, len = ref.length; j < len; j++) { 7 | d = ref[j]; 8 | if (eff(d)) break; 9 | if (eff(2)) break lab; 10 | } 11 | eff(3); 12 | eff(4); 13 | } 14 | eff(5); 15 | eff(6); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test14-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | return M.chain(eff(i), _1); 6 | function _1() { 7 | if (i++) { 8 | return M.chain(eff1(i), _2); 9 | } else { 10 | return M.chain(eff2(i), _2); 11 | } 12 | } 13 | function _2() { 14 | return M.chain(eff(i), _3); 15 | } 16 | function _3() {} 17 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test04-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var e, ex; 4 | return M.jump(void 0, _1, _4); 5 | function _1() { 6 | return M.chain(eff(1), _3); 7 | } 8 | function _2() { 9 | e = ex; 10 | console.log(e); 11 | } 12 | function _3() {} 13 | function _4(a) { 14 | ex = a; 15 | return M.jump(void 0, _2); 16 | } 17 | } -------------------------------------------------------------------------------- /packages/serialization/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs", 5 | "lib": ["esnext", "dom", "dom.iterable"], 6 | "outDir": ".", 7 | "strict": true, 8 | "alwaysStrict": true, 9 | "declaration": true, 10 | "noFallthroughCasesInSwitch": false, 11 | "noImplicitAny": false 12 | 13 | }, 14 | "files": ["src/main.ts", "src/dom.ts"] 15 | } 16 | -------------------------------------------------------------------------------- /packages/core/babel/preset-react.js: -------------------------------------------------------------------------------- 1 | module.exports = function (transform) { 2 | const preset = require("./preset")(transform); 3 | return function (opts = { preInstrumentedLibs: true }) { 4 | return { 5 | passPerPreset: true, 6 | presets: [ 7 | [require.resolve("@babel/preset-react"), opts.react || {}], 8 | ...require("./preset")(opts).presets, 9 | ], 10 | }; 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/clos-conv-in.js: -------------------------------------------------------------------------------- 1 | let i; 2 | eff_top(); 3 | function yh(a) { 4 | let j = (i += a); 5 | eff(); 6 | return function eh() { 7 | eff((i += j)); 8 | }; 9 | } 10 | 11 | M.option({ 12 | varStorageField: "$", 13 | closureStorageField: "$$" 14 | }); 15 | 16 | function yh2(a) { 17 | let j = (i += a); 18 | eff(); 19 | return function eh() { 20 | eff((i += j)); 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/wrap-arg-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function z2() { 3 | var z2 = M.context(); 4 | z2.__args = M.args(arguments); 5 | ; 6 | return M.scope(z2_1); 7 | } 8 | function z2_1(z2) { 9 | return M.chain(eff(1), z2_2); 10 | } 11 | function z2_2(z2) { 12 | var a; 13 | a = z2.__args, z2.__args = null; 14 | return M.chain(aff(a), z2_3); 15 | } 16 | function z2_3(z2) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test13-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | if (t) { 6 | return M.chain(eff1(i), _1); 7 | } else { 8 | i++; 9 | return M.jump(void 0, _1); 10 | } 11 | function _1() { 12 | return M.chain(eff2(i), _2); 13 | } 14 | function _2() { 15 | return M.chain(eff3(i), _3); 16 | } 17 | function _3() {} 18 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test14-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a, b; 4 | return M.chain(eff(1), _1); 5 | function _1(b) { 6 | a = b; 7 | return M.chain(eff(2), _2); 8 | } 9 | function _2(a) { 10 | b = a; 11 | return M.chain(eff(3), _3); 12 | } 13 | function _3(c) { 14 | return M.chain(a(b, c, 4), _4); 15 | } 16 | function _4() {} 17 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test20-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff("1"), a_2); 8 | } 9 | function a_2(a, b) { 10 | console.log(b, 3); 11 | console.log("2"); 12 | console.log("3"); 13 | return M.chain(eff(2), a_3); 14 | } 15 | function a_3(a, b) { 16 | return b; 17 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test20-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | i = 0; 5 | return M.chain(eff0(i), _1); 6 | function _1() { 7 | i++; 8 | return M.chain(eff1(i), _2); 9 | } 10 | function _2() { 11 | return M.chain(eff1(i), _3); 12 | } 13 | function _3() { 14 | i++; 15 | return M.chain(eff1(i), _4); 16 | } 17 | function _4() {} 18 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test04-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1, a_4); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_3); 8 | } 9 | function a_2(a) { 10 | var e; 11 | e = a._ex; 12 | console.log(e); 13 | } 14 | function a_3(a) {} 15 | function a_4(a, b) { 16 | a._ex = b; 17 | return M.jump(void 0, a_2); 18 | } -------------------------------------------------------------------------------- /packages/debugger/test/modules.test.js: -------------------------------------------------------------------------------- 1 | require("./setup"); 2 | const trace = require("./run"); 3 | trace.silent = true; 4 | const D = require("../main"); 5 | 6 | test("modules tracing", function() { 7 | global.console = { log: jest.fn(), error: console.error }; 8 | D.context.debug = true; 9 | debugger; 10 | trace(D.force(require("./__fixtures__/mod"))); 11 | expect(console.log.mock.calls).toMatchSnapshot(); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/es-rt/src/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "development": { 4 | "plugins": [ 5 | "@babel/transform-modules-commonjs", 6 | "transform-inline-environment-variables", 7 | "minify-dead-code-elimination"] 8 | }, 9 | "configure": { 10 | "plugins": [ 11 | "transform-inline-environment-variables", 12 | "minify-dead-code-elimination"] 13 | } 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test03-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i; 4 | return M.chain(eff0(), _1); 5 | function _1() { 6 | i = 0; 7 | i++; 8 | return M.chain(eff1(i), _2); 9 | } 10 | function _2() { 11 | if (t) { 12 | return M.chain(eff2(i), _3); 13 | } else { 14 | return M.chain(eff3(i), _3); 15 | } 16 | } 17 | function _3() {} 18 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test33-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | return M.chain(eff(1), _1); 4 | function _1() { 5 | return M.chain(eff(2), _2); 6 | } 7 | function _2(a) { 8 | if (a) { 9 | return M.chain(eff3(), _3); 10 | } else { 11 | b; 12 | } 13 | } 14 | function _3() { 15 | return M.chain(eff4(), _4); 16 | } 17 | function _4() {} 18 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test15-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(effb(2), a_2); 8 | } 9 | function a_2(a, b) { 10 | return M.chain(eff(b), a_3); 11 | } 12 | function a_3(a, b) { 13 | a._ = b; 14 | return M.chain(effc(3), a_4); 15 | } 16 | function a_4(a, b) { 17 | 5 + a._ + b; 18 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/loops/test07-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i, j, k; 4 | i = 0; 5 | j = 0; 6 | k = 0; 7 | return M.chain(eff(i, j, k), _1); 8 | function _1() { 9 | return M.chain(eff1(i), _2); 10 | } 11 | function _2() { 12 | k = 10; 13 | return M.chain(eff2(), _3); 14 | } 15 | function _3() { 16 | return M.chain(eff4(k, j), _3); 17 | } 18 | } -------------------------------------------------------------------------------- /packages/core/test/samples/for-stmt/body-eff/test1-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | (function () { 3 | var i, j, len, ref; 4 | ref = [1, 2, 3]; 5 | j = 0, len = ref.length; 6 | return M.jump(void 0, _1); 7 | function _1() { 8 | if (j < len) { 9 | i = ref[j]; 10 | return M.chain(eff(i), _2); 11 | } 12 | } 13 | function _2() { 14 | j++; 15 | return M.jump(void 0, _1); 16 | } 17 | }); -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test17-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(effc(3), a_2); 8 | } 9 | function a_2(a, b) { 10 | a._ = b; 11 | return M.chain(effb(2), a_3); 12 | } 13 | function a_3(a, b) { 14 | return M.chain(eff(b + 4), a_4); 15 | } 16 | function a_4(a, b) { 17 | 5 + a._ + b; 18 | } -------------------------------------------------------------------------------- /packages/core/test/kit/generate-sm.js: -------------------------------------------------------------------------------- 1 | var staticModule = require("static-module"); 2 | var JSONStream = require("JSONStream"); 3 | var dirs = require("./dirs"); 4 | 5 | var sm = staticModule({ 6 | dirs: { 7 | read: function(path) { 8 | return JSON.stringify(dirs.read(path)); 9 | } 10 | } 11 | }); 12 | 13 | module.exports = function(file, opts) { 14 | return sm; 15 | }; 16 | 17 | process.stdin.pipe(sm).pipe(process.stdout); 18 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/minimal-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | eff(1); 4 | eff(2); 5 | return eff(3); 6 | } 7 | function b() { 8 | var b = M.context(); 9 | return M.scope(b_1); 10 | } 11 | function b_1(b) { 12 | eff(1); 13 | return M.chain(eff(2), b_2); 14 | } 15 | function b_2(b) { 16 | eff(3); 17 | return M.chain(eff(4), b_3); 18 | } 19 | function b_3(b) { 20 | return 5; 21 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test11-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | a._ = b; 11 | return M.chain(eff(2), a_3); 12 | } 13 | function a_3(a, b) { 14 | var c; 15 | c = a._, a._ = null; 16 | return M.chain(c(b), a_4); 17 | } 18 | function a_4(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test12-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | a._ = b; 11 | return M.chain(eff(2), a_3); 12 | } 13 | function a_3(a, b) { 14 | var c; 15 | c = a._, a._ = null; 16 | return M.chain(c(b), a_4); 17 | } 18 | function a_4(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/profiles/test03-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(p1(), a_2); 8 | } 9 | function a_2(a) { 10 | return M.chain(p2(), a_3); 11 | } 12 | function a_3(a) { 13 | return M.chain(e1(), a_4); 14 | } 15 | function a_4(a) { 16 | return M.chain(e(2), a_5); 17 | } 18 | function a_5(a) {} -------------------------------------------------------------------------------- /packages/core/README.md: -------------------------------------------------------------------------------- 1 | # @effectful/core 2 | 3 | The main library of transforms used by all the other presets. 4 | 5 | ## Usage 6 | 7 | Unless you are effects library implementer, you don't need 8 | to use this library directly. 9 | 10 | There is not much documentation for implementers yet. 11 | Contact me if you wish to make something with it. 12 | 13 | ## LICENSE 14 | 15 | Distributed under the terms of The MIT License (MIT). 16 | 17 | 18 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/hoist-top-in.js: -------------------------------------------------------------------------------- 1 | M.profile("es"); 2 | import b from "some"; 3 | export let [, a] = b; 4 | function a1() {} 5 | { 6 | class Some { 7 | async a() { 8 | await b_1; 9 | } 10 | } 11 | let b = a; 12 | const [, other, b2] = Some; 13 | async function somethingElse() { 14 | return async function zz() { 15 | await eff_1(new Some()); 16 | await eff_2(a, b); 17 | }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test10-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | a._ = b; 11 | return M.chain(eff(2), a_3); 12 | } 13 | function a_3(a, b) { 14 | var c; 15 | c = a._, a._ = null; 16 | return M.chain(effC(c, b), a_4); 17 | } 18 | function a_4(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test16-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | a._ = b; 11 | return M.chain(eff(2), a_3); 12 | } 13 | function a_3(a, b) { 14 | var c; 15 | c = a._, a._ = null; 16 | return M.chain(c(b + 2), a_4); 17 | } 18 | function a_4(a) {} -------------------------------------------------------------------------------- /packages/es-inline/test/async.js: -------------------------------------------------------------------------------- 1 | const run = require("../../es/test/templates/async"); 2 | describe("async/await with inlined operations", function() { 3 | run("with default options", require("./default/links/async")); 4 | run("with right associative bind", require("./right/links/async")); 5 | }); 6 | 7 | describe("async/await with loose inlined operations", function() { 8 | run("with default options", require("./loose/links/async")); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/serialization/api/interfaces/_main_.jsonobject.md: -------------------------------------------------------------------------------- 1 | [@effectful/serialization](../README.md) › ["main"](../modules/_main_.md) › [JSONObject](_main_.jsonobject.md) 2 | 3 | # Interface: JSONObject 4 | 5 | `JSON.stringify` serializable Object 6 | 7 | ## Hierarchy 8 | 9 | * **JSONObject** 10 | 11 | ## Indexable 12 | 13 | * \[ **name**: *string*\]: [JSONValue](../modules/_main_.md#jsonvalue) 14 | 15 | `JSON.stringify` serializable Object 16 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/next-in.js: -------------------------------------------------------------------------------- 1 | // *- SKIP 2 | function a() { 3 | M.option.when("name==='eff'", { bind: false, count: 1 }); 4 | eff(1); 5 | eff(2); 6 | eff(3); 7 | } 8 | 9 | M.option.when("name === 'pureonce'", { 10 | identity: true, 11 | apply: { 12 | cond: "call", 13 | bind: false, 14 | count: 1 15 | } 16 | }); 17 | 18 | function b() { 19 | pureonce(); 20 | eff1(1) + 2; 21 | eff1(2); 22 | eff1(3); 23 | } 24 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test60-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(read1(), a_2); 8 | } 9 | function a_2(a, b) { 10 | a._i = b; 11 | return M.chain(eff(a._i), a_3); 12 | } 13 | function a_3(a) { 14 | var b; 15 | b = a._i, a._i = null; 16 | return M.chain(write(b), a_4); 17 | } 18 | function a_4(a) {} -------------------------------------------------------------------------------- /packages/debugger/api/interfaces/_state_.scopeinfo.md: -------------------------------------------------------------------------------- 1 | [@effectful/debugger](../README.md) › ["state"](../modules/_state_.md) › [ScopeInfo](_state_.scopeinfo.md) 2 | 3 | # Interface: ScopeInfo 4 | 5 | pre-calculated scope information 6 | 7 | ## Hierarchy 8 | 9 | * **ScopeInfo** 10 | 11 | ## Indexable 12 | 13 | * \[ **name**: *string*\]: [VarInfo](../modules/_state_.md#varinfo) 14 | 15 | original variable name to its storing index and depth to parent 16 | -------------------------------------------------------------------------------- /packages/es-inline/README.md: -------------------------------------------------------------------------------- 1 | # @effectful/es-inline 2 | 3 | A short cut for [@effectful/es](https://github.com/awto/effectfuljs/tree/master/packages/es) 4 | with `{inline:true, defunct:true}` parameters. 5 | 6 | For zero configuration transform with [babel-plugin-macros](https://github.com/kentcdodds/babel-plugin-macros), 7 | import "@effectful/es-inline/macro". 8 | 9 | ## LICENSE 10 | 11 | Distributed under the terms of The MIT License (MIT). 12 | 13 | -------------------------------------------------------------------------------- /samples/persist-boxes/README.md: -------------------------------------------------------------------------------- 1 | # Demo project for [@effectful/es-persist](https://github.com/awto/effectfuljs/tree/master/packages/es-persist) 2 | 3 | ## Usage: 4 | 5 | ``` 6 | $ npm run start 7 | ``` 8 | 9 | Open [http://localhost:8080](http://localhost:8080) 10 | 11 | Draw boxes by holding mouse left button when moving, 12 | delete them with right mouse click. 13 | 14 | The boxes are stored in localStorage so they survive browser's restart. 15 | 16 | -------------------------------------------------------------------------------- /packages/debugger/src/kit.ts: -------------------------------------------------------------------------------- 1 | /** pure versions of RT functions */ 2 | 3 | export function map(arr: T[], f: (v: T) => U): U[] { 4 | const len = arr.length; 5 | const res = new Array(len); 6 | for (let i = 0; i < len; ++i) res[i] = f(arr[i]); 7 | return res; 8 | } 9 | 10 | export function filter(arr: T[], pred: (v: T) => boolean): T[] { 11 | const res: T[] = []; 12 | for (const i of arr) if (pred(i)) res.push(i); 13 | return res; 14 | } 15 | -------------------------------------------------------------------------------- /packages/debugger/test/__fixtures__/eval.js: -------------------------------------------------------------------------------- 1 | let g = "g"; 2 | export function runEval() { 3 | let a = "a"; 4 | return function() { 5 | let b = "b"; 6 | console.log("before eval", g, a, b); 7 | eval( 8 | `console.log('hi', g, a, b, this); a+=b+g; console.log('there', g, a, b)` 9 | ); 10 | console.log("eval", eval("a + b + g")); 11 | console.log("after eval", g, a, b); 12 | return [g, a, b]; 13 | }.call({ obj: true }); 14 | } 15 | -------------------------------------------------------------------------------- /packages/core/test/samples/options/eval.opts: -------------------------------------------------------------------------------- 1 | { 2 | "contextState": true, 3 | "closureShortcuts": false, 4 | "closureStorageField": "C", 5 | "varStorageField": "V", 6 | "evalCtx": { 7 | "a": ["_a", 0], 8 | "b": ["_b", 1], 9 | "c": ["_c", 2] 10 | }, 11 | "evalContext": { 12 | "a": [4, 0], 13 | "b": [5, 1], 14 | "c": [6, 2] 15 | }, 16 | "contextMethodOps":true, 17 | "injectEvalCtx":true, 18 | "injectFuncMeta": "meta" 19 | } 20 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test01-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var j; 4 | j = 0; 5 | return M.chain(eff(j), _1); 6 | function _1() { 7 | var a; 8 | a = j++; 9 | return M.chain(eff(a), _2); 10 | } 11 | function _2() { 12 | return M.chain(eff2(j), _3); 13 | } 14 | function _3() { 15 | var a; 16 | a = j++; 17 | return M.chain(eff3(a), _4); 18 | } 19 | function _4() {} 20 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/expr/test21-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | a.__this = this; 5 | return M.scope(a_1); 6 | } 7 | function a_1(a) { 8 | return M.chain(eff(1), a_2); 9 | } 10 | function a_2(a) { 11 | return M.chain(a.__this.eff(2), a_3); 12 | } 13 | function a_3(a) { 14 | var b; 15 | b = a.__this, a.__this = null; 16 | return M.chain(eff3(b), a_4); 17 | } 18 | function a_4(a) {} -------------------------------------------------------------------------------- /packages/core/test/samples/for-stmt/last/test1-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | (function () { 3 | var i, j, len, ref; 4 | ref = [1, 2, 3]; 5 | j = 0, len = ref.length; 6 | return M.jump(void 0, _1); 7 | function _1() { 8 | if (j < len) { 9 | i = ref[j]; 10 | return M.chain(eff(i), _2); 11 | } 12 | } 13 | function _2(a) { 14 | if (a) {} else { 15 | j++; 16 | return M.jump(void 0, _1); 17 | } 18 | } 19 | }); -------------------------------------------------------------------------------- /packages/core/test/samples/if-stmt/all-eff-out-ft.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var a = M.context(); 4 | return M.scope(a_1); 5 | } 6 | function a_1(a) { 7 | return M.chain(eff(1), a_2); 8 | } 9 | function a_2(a, b) { 10 | if (b) { 11 | return M.chain(eff(2), a_3); 12 | } else { 13 | return M.chain(eff(3), a_4); 14 | } 15 | } 16 | function a_3(a, b) { 17 | return b; 18 | } 19 | function a_4(a, b) { 20 | return b; 21 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test18-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i, a; 4 | i = 0; 5 | a = i++; 6 | return M.chain(eff0(a), _1); 7 | function _1() { 8 | return M.chain(eff1(i), _2); 9 | } 10 | function _2() { 11 | i += 1; 12 | return M.chain(eff2(2), _3); 13 | } 14 | function _3() { 15 | var a; 16 | a = i += 2; 17 | return M.chain(eff3(a), _4); 18 | } 19 | function _4() {} 20 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test26-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i, a; 4 | a = i++; 5 | return M.chain(eff1(a), _1); 6 | function _1(a) { 7 | i = a; 8 | return M.chain(eff2(i), _2); 9 | } 10 | function _2() { 11 | var a; 12 | a = i++; 13 | return M.chain(eff3(a), _3); 14 | } 15 | function _3(a) { 16 | i = a; 17 | return M.chain(eff4(i), _4); 18 | } 19 | function _4() {} 20 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test41-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | { 3 | eff1(); 4 | if (a1) { 5 | eff2(); 6 | } 7 | } 8 | M.option({ coerce: false }); 9 | { 10 | eff3(); 11 | if (a2) { 12 | eff4(); 13 | } 14 | } 15 | { 16 | M.option({ coerce: true }); 17 | eff5(); 18 | if (a3) { 19 | eff6(); 20 | } 21 | } 22 | { 23 | eff7(); 24 | if (a4) { 25 | eff8(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/core/test/samples/simple/block/test45-out-f.js: -------------------------------------------------------------------------------- 1 | import * as M from "@effectful/core"; 2 | function a() { 3 | var i, a; 4 | i = 0; 5 | a = i++; 6 | return M.chain(eff5(a), _1); 7 | function _1() { 8 | var a; 9 | if (ee) { 10 | a = i++; 11 | return M.chain(eff7(a), _2); 12 | } else { 13 | return M.jump(void 0, _2); 14 | } 15 | } 16 | function _2() { 17 | return M.chain(eff8(i), _3); 18 | } 19 | function _3() {} 20 | } -------------------------------------------------------------------------------- /packages/core/test/samples/simple/exceptions/test03-in.js: -------------------------------------------------------------------------------- 1 | function a() { 2 | var e, error; 3 | try { 4 | console.log("1"); 5 | eff(1); 6 | } catch (error) { 7 | e = error; 8 | console.log("2"); 9 | } 10 | eff(e); 11 | } 12 | 13 | function b() { 14 | var e, error; 15 | try { 16 | console.log("1"); 17 | eff(1); 18 | } catch (error) { 19 | e = error; 20 | console.log("2"); 21 | error = null; 22 | } 23 | eff(e); 24 | } 25 | --------------------------------------------------------------------------------