Checkpoint before integration and package validation. Assisted-by: SurmAgent:unknown [read] [edit] [bash]
39 lines
656 B
JavaScript
39 lines
656 B
JavaScript
import {assert} from "./assert.js"
|
|
|
|
let ex
|
|
try {
|
|
null.x
|
|
} catch (e) {
|
|
ex = e
|
|
}
|
|
assert(ex instanceof TypeError)
|
|
assert(ex.message, "cannot read property 'x' of null")
|
|
ex = undefined
|
|
|
|
try {
|
|
null["x"]
|
|
} catch (e) {
|
|
ex = e
|
|
}
|
|
assert(ex instanceof TypeError)
|
|
assert(ex.message, "cannot read property 'x' of null")
|
|
ex = undefined
|
|
|
|
try {
|
|
undefined.x
|
|
} catch (e) {
|
|
ex = e
|
|
}
|
|
assert(ex instanceof TypeError)
|
|
assert(ex.message, "cannot read property 'x' of undefined")
|
|
ex = undefined
|
|
|
|
try {
|
|
undefined["x"]
|
|
} catch (e) {
|
|
ex = e
|
|
}
|
|
assert(ex instanceof TypeError)
|
|
assert(ex.message, "cannot read property 'x' of undefined")
|
|
ex = undefined
|