haikuwebkit/JSTests/stress/string-prototype-scopes-glo...

16 lines
291 B
JavaScript

"use strict";
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
var error = null;
let charAt = String.prototype.charAt;
try {
charAt();
} catch (e) {
error = e;
}
shouldBe(String(error), `TypeError: Type error`);