Skip to content

Commit bd3ea5e

Browse files
committed
address comments
1 parent c1c5e42 commit bd3ea5e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/webgpu/idl/javascript.spec.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ g.test('getter_replacement')
385385
// check replacing the getter on constructor works.
386386
const ctorPrototype = obj.constructor.prototype;
387387
const origProperties = Object.getOwnPropertyDescriptor(ctorPrototype, getter);
388-
t.expect(
388+
assert(
389389
!!origProperties,
390390
`Object.getOwnPropertyDescriptor(${type}, '${getter}') !== undefined`
391391
);
@@ -401,14 +401,17 @@ g.test('getter_replacement')
401401
`replacing getter: '${getter}' on ${type} returns test value`
402402
);
403403
} finally {
404-
Object.defineProperty(ctorPrototype, getter, origProperties!);
404+
Object.defineProperty(ctorPrototype, getter, origProperties);
405405
}
406406

407407
// Check it turns the same value after restoring as before restoring.
408408
const afterValue = (obj as unknown as Record<string, () => unknown>)[getter];
409-
t.expect(
410-
afterValue === origValue,
411-
`able to restore getter for instance of ${type}.${getter}`
409+
assert(afterValue === origValue, `able to restore getter for instance of ${type}.${getter}`);
410+
411+
// Check getOwnProperty also returns the value we got before.
412+
assert(
413+
Object.getOwnPropertyDescriptor(ctorPrototype, getter)!.get === origProperties.get,
414+
`getOwnPropertyDescriptor(${type}, '${getter}').get is original function`
412415
);
413416
}
414417
});
@@ -456,7 +459,7 @@ g.test('method_replacement')
456459
}
457460

458461
// Check the function the prototype and the one on the object are the same after restoring.
459-
t.expect(
462+
assert(
460463
(obj as unknown as Record<string, unknown>)[method] === origFunc,
461464
`instance of ${type}.${method} === ${type}.prototype.${method}`
462465
);

0 commit comments

Comments
 (0)