Skip to content

Commit 05bb41e

Browse files
committed
Check the Map.prototype
1 parent 92ec8a8 commit 05bb41e

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • packages/@glimmer/validator/test/collections

packages/@glimmer/validator/test/collections/map-test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ module('@glimmer/validator: trackedMap', function () {
5252
test('getOrInsert', (assert) => {
5353
const map = trackedMap();
5454

55-
if ('getOrInsert' in map && typeof map.getOrInsert === 'function') {
55+
if (
56+
'getOrInsert' in map &&
57+
typeof map.getOrInsert === 'function' &&
58+
'getOrInsert' in Map.prototype
59+
) {
5660
let v = map.getOrInsert('foo', 123);
5761
assert.strictEqual(v, 123);
5862

@@ -68,7 +72,11 @@ module('@glimmer/validator: trackedMap', function () {
6872
test('getOrInsertComputed', (assert) => {
6973
const map = trackedMap();
7074

71-
if ('getOrInsertComputed' in map && typeof map.getOrInsertComputed === 'function') {
75+
if (
76+
'getOrInsertComputed' in map &&
77+
typeof map.getOrInsertComputed === 'function' &&
78+
'getOrInsertComputed' in Map.prototype
79+
) {
7280
let v = map.getOrInsertComputed('foo', (key: string) => `${key}!`);
7381
assert.strictEqual(v, 'foo!');
7482

0 commit comments

Comments
 (0)