mirror of
https://github.com/radareorg/quickjs.git
synced 2026-11-07 14:38:27 -10:00
Also fix a small memory leak in the output from `qjsc -e`. Fixes: https://github.com/quickjs-ng/quickjs/issues/217
15 lines
285 B
JavaScript
15 lines
285 B
JavaScript
"use strict"
|
|
const expect = "function f() { return 42 }"
|
|
function f() { return 42 }
|
|
|
|
{
|
|
const actual = f.toString()
|
|
if (actual !== expect) throw Error(actual)
|
|
}
|
|
|
|
{
|
|
const f = eval(expect + "f")
|
|
const actual = f.toString()
|
|
if (actual !== expect) throw Error(actual)
|
|
}
|