mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
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)
|
||
|
}
|