2024-08-03 00:24:00 -05:00
|
|
|
// This tests computed properties.
|
|
|
|
|
2025-04-30 13:12:40 +12:00
|
|
|
arr = [0, 0, 0, 10]
|
|
|
|
i = 3
|
|
|
|
ten = arr[i]
|
2024-08-03 00:24:00 -05:00
|
|
|
|
2025-04-22 12:44:52 -05:00
|
|
|
assert(ten, isEqualTo = 10, error = "oops")
|
2024-08-03 00:24:00 -05:00
|
|
|
|
2025-04-30 13:12:40 +12:00
|
|
|
p = "foo"
|
|
|
|
obj = {
|
2024-08-03 00:24:00 -05:00
|
|
|
foo: 1,
|
|
|
|
bar: 0,
|
|
|
|
}
|
2025-04-30 13:12:40 +12:00
|
|
|
one = obj[p]
|
2024-08-03 00:24:00 -05:00
|
|
|
|
2025-04-22 12:44:52 -05:00
|
|
|
assert(one, isEqualTo = 1, error = "oops")
|