<!DOCTYPEhtml> <!-- Submitted from TestTWF Paris -->
<meta charset=utf-8">
<title>Invalid key</title>
<link rel=help href="http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#key-construct">
<link rel=assert title="A value is said to be a valid key if it is one of the following types: Array JavaScript objects [ECMA-262], DOMString [WEBIDL], Date [ECMA-262] or float [WEBIDL]. However Arrays are only valid keys if every item in the array is defined and is a valid key (i.e. sparse arrays can not be valid keys) and if the Array doesn't directly or indirectly contain itself. Any non-numeric properties are ignored, and thus does not affect whether the Array is a valid key. Additionally, if the value is of type float, it is only a valid key if it is not NaN, and if the value is of type Date it is only a valid key if its [[PrimitiveValue]] internal property, as defined by [ECMA-262], is not NaN. Conforming user agents must support all valid keys as keys."> <!-- original author -->
<link rel=author href="mailto:odinho@opera.com"title="Odin Hørthe Omdal"> <!-- some additions by Baptiste Fontaine (batifon@yahoo.fr) -->
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=resources/support.js></script>
<script> var db = createdb_for_multiple_tests(),
// cache for ObjectStores
objStore = null,
objStore2 = null;
function invalid_key(desc, key) { var t = async_test(document.title + " - " + desc);
// set the current test, and run it
db.setTest(t).onupgradeneeded = function(e) {
objStore = objStore || e.target.result.createObjectStore("store");
assert_throws_dom('DataError', function() {
objStore.add("value", key);
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.