summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/test-common.js
blob: b466a3f010629baf6ea693da98519e3687d03d65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

function AssertionError(message) {
    var instance = new Error(message);
    instance.name = 'AssertionError';
    Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
    return instance;
}

function assert(value) {
    if (!value)
        throw new AssertionError("The assertion failed!");
}

function assertNotReached() {
    throw new AssertionError("assertNotReached() was reached!");
}