idbindex-objectStore-SameObject.any.js (861B)
1 // META: title=IndexedDB: objectStore SameObject 2 // META: global=window,worker 3 // META: script=resources/support.js 4 // Spec: "https://w3c.github.io/IndexedDB/#dom-idbindex-objectstore" 5 'use strict'; 6 7 indexeddb_test( 8 (t, db) => { 9 const store = db.createObjectStore('store'); 10 const index = store.createIndex('index', 'keyPath'); 11 assert_equals( 12 index.objectStore, index.objectStore, 13 'Attribute should yield the same object each time'); 14 }, 15 (t, db) => { 16 const tx = db.transaction('store', 'readonly'); 17 const store = tx.objectStore('store'); 18 const index = store.index('index'); 19 assert_equals( 20 index.objectStore, index.objectStore, 21 'Attribute should yield the same object each time'); 22 t.done(); 23 }, 24 'IDBIndex.objectStore should return same object each time.');