blob: 14b3aec4eb55d9287a1bc43c6d9bf7d618ba696b [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
shouldBe(callerSourceOrigin().endsWith('source-origin.js'), true);
shouldBe([ 0 ].map(callerSourceOrigin)[0].endsWith('source-origin.js'), true);
shouldBe(eval(`callerSourceOrigin()`).endsWith('source-origin.js'), true);
shouldBe((0, eval)(`callerSourceOrigin()`).endsWith('source-origin.js'), true);
shouldBe((new Function(`return callerSourceOrigin()`))().endsWith('source-origin.js'), true);
shouldBe((Function(`return callerSourceOrigin()`))().endsWith('source-origin.js'), true);