haikuwebkit/JSTests/stress/bytecode-cache-syntax-error.js

10 lines
256 B
JavaScript

//@ runBytecodeCacheNoAssertion
try {
loadString('function(){}');
throw new Error('loadString should have thrown');
} catch (err) {
if (err.message != 'Function statements must have a name.')
throw new Error('Unexpected exception');
}