Make .get() and .delete() not produce an error if the record doesn't exist
authorJonas Sicking <jonas@sicking.cc>
Mon, 08 Nov 2010 08:22:59 -0800
changeset 83aa86fe36c96e
parent 82 2e1f77b9fd72
child 84 0901d0b89904
Make .get() and .delete() not produce an error if the record doesn't exist
Overview.html
Speclet_021_IDB_API_Algorithms.html
     1.1 --- a/Overview.html	Mon Nov 08 03:53:04 2010 -0800
     1.2 +++ b/Overview.html	Mon Nov 08 08:22:59 2010 -0800
     1.3 @@ -3334,9 +3334,7 @@
     1.4                retreive the first <a>record</a> from <var>store</var> whose key is <a title="in a key range">in</a> <var>key</var>.
     1.5              </li>
     1.6              <li>
     1.7 -              If no record was found in the previous step,
     1.8 -              then terminate these steps and set error code
     1.9 -              <a class="idlType" href="#widl-IDBDatabaseException-NOT_FOUND_ERR"><code>NOT_FOUND_ERR</code></a>.
    1.10 +              If no record was found, the result of this algorithm is <code>undefined</code>.
    1.11              </li>
    1.12              <li>
    1.13                The result of this algorithm is a new <a>structured clone</a> of the value in the found record.
    1.14 @@ -3363,8 +3361,7 @@
    1.15                find the first <a>record</a> from <var>index</var> whose key is <a title="in a key range">in</a> <var>key</var>.
    1.16              </li>
    1.17              <li>
    1.18 -              If no record was found in the previous step, then the algorithm failed with a
    1.19 -              <a class="idlType" href="#widl-IDBDatabaseException-NOT_FOUND_ERR"><code>NOT_FOUND_ERR</code> error</a>.
    1.20 +              If no record was found, the result of this algorithm is <code>undefined</code>.
    1.21              </li>
    1.22              <li>
    1.23                Otherwise, the result of the operation is the <a>referenced value</a> of the found record.
    1.24 @@ -3391,8 +3388,7 @@
    1.25                find the first <a>record</a> from <var>index</var> whose key is <a title="in a key range">in</a> <var>key</var>.
    1.26              </li>
    1.27              <li>
    1.28 -              If no record was found in the previous step, then the algorithm failed with a
    1.29 -              <a class="idlType" href="#widl-IDBDatabaseException-NOT_FOUND_ERR"><code>NOT_FOUND_ERR</code> error</a>.
    1.30 +              If no record was found, the result of this algorithm is <code>undefined</code>.
    1.31              </li>
    1.32              <li>
    1.33                If a record was found, the result of this algorithm is the <a>value</a> of the found <a>record</a>.
    1.34 @@ -3410,12 +3406,9 @@
    1.35            <ol>
    1.36              <li>
    1.37                If no <a>record</a> exists with key <var>key</var> in <var>store</var>,
    1.38 -              then terminate these steps and set error code
    1.39 -              <a class="idlType" href="#widl-IDBDatabaseException-NOT_FOUND_ERR"><code>NOT_FOUND_ERR</code></a>.
    1.40 -              <p class="issue">
    1.41 -                Should we instead return a boolean indicating if a record was found or not?
    1.42 -              </p>
    1.43 -            </li>            
    1.44 +              then the result of this algorithm is <code>false</code> and no more steps in this
    1.45 +              algorithm are executed.
    1.46 +            </li>
    1.47              <li>
    1.48                 Remove the record from <var>store</var> with key <var>key</var>.
    1.49              </li>
    1.50 @@ -3424,7 +3417,7 @@
    1.51                <a>records</a> with value <var>key</var>.
    1.52              </li>
    1.53              <li>
    1.54 -              The result of this algorithm is <code>undefined</code>.
    1.55 +              The result of this algorithm is <code>true</code>.
    1.56              </li>
    1.57            </ol>
    1.58          </section>
     2.1 --- a/Speclet_021_IDB_API_Algorithms.html	Mon Nov 08 03:53:04 2010 -0800
     2.2 +++ b/Speclet_021_IDB_API_Algorithms.html	Mon Nov 08 08:22:59 2010 -0800
     2.3 @@ -551,9 +551,7 @@
     2.4                retreive the first <a>record</a> from <var>store</var> whose key is <a title="in a key range">in</a> <var>key</var>.
     2.5              </li>
     2.6              <li>
     2.7 -              If no record was found in the previous step,
     2.8 -              then terminate these steps and set error code
     2.9 -              <a class="idlType" href="#widl-IDBDatabaseException-NOT_FOUND_ERR"><code>NOT_FOUND_ERR</code></a>.
    2.10 +              If no record was found, the result of this algorithm is <code>undefined</code>.
    2.11              </li>
    2.12              <li>
    2.13                The result of this algorithm is a new <a>structured clone</a> of the value in the found record.
    2.14 @@ -580,8 +578,7 @@
    2.15                find the first <a>record</a> from <var>index</var> whose key is <a title="in a key range">in</a> <var>key</var>.
    2.16              </li>
    2.17              <li>
    2.18 -              If no record was found in the previous step, then the algorithm failed with a
    2.19 -              <a class="idlType" href="#widl-IDBDatabaseException-NOT_FOUND_ERR"><code>NOT_FOUND_ERR</code> error</a>.
    2.20 +              If no record was found, the result of this algorithm is <code>undefined</code>.
    2.21              </li>
    2.22              <li>
    2.23                Otherwise, the result of the operation is the <a>referenced value</a> of the found record.
    2.24 @@ -608,8 +605,7 @@
    2.25                find the first <a>record</a> from <var>index</var> whose key is <a title="in a key range">in</a> <var>key</var>.
    2.26              </li>
    2.27              <li>
    2.28 -              If no record was found in the previous step, then the algorithm failed with a
    2.29 -              <a class="idlType" href="#widl-IDBDatabaseException-NOT_FOUND_ERR"><code>NOT_FOUND_ERR</code> error</a>.
    2.30 +              If no record was found, the result of this algorithm is <code>undefined</code>.
    2.31              </li>
    2.32              <li>
    2.33                If a record was found, the result of this algorithm is the <a>value</a> of the found <a>record</a>.
    2.34 @@ -627,12 +623,9 @@
    2.35            <ol>
    2.36              <li>
    2.37                If no <a>record</a> exists with key <var>key</var> in <var>store</var>,
    2.38 -              then terminate these steps and set error code
    2.39 -              <a class="idlType" href="#widl-IDBDatabaseException-NOT_FOUND_ERR"><code>NOT_FOUND_ERR</code></a>.
    2.40 -              <p class="issue">
    2.41 -                Should we instead return a boolean indicating if a record was found or not?
    2.42 -              </p>
    2.43 -            </li>            
    2.44 +              then the result of this algorithm is <code>false</code> and no more steps in this
    2.45 +              algorithm are executed.
    2.46 +            </li>
    2.47              <li>
    2.48                 Remove the record from <var>store</var> with key <var>key</var>.
    2.49              </li>
    2.50 @@ -641,7 +634,7 @@
    2.51                <a>records</a> with value <var>key</var>.
    2.52              </li>
    2.53              <li>
    2.54 -              The result of this algorithm is <code>undefined</code>.
    2.55 +              The result of this algorithm is <code>true</code>.
    2.56              </li>
    2.57            </ol>
    2.58          </section>