Speedometer 2.0: Fix vanilla JS example
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Jul 2017 10:25:00 +0000 (10:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Jul 2017 10:25:00 +0000 (10:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174246

Patch by Mathias Bynens <mathias@qiwi.be> on 2017-07-07
Reviewed by Ryosuke Niwa.

Previously, all TODO items were assigned an ID of `null`. This patch
fixes that bug. Manually deleting items now works again.

* Speedometer/resources/todomvc/vanilla-examples/vanillajs/index.html: Made title consistent.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/store.js: Fixed bug with deleting items.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/readme.md: Added docs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219251 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/ChangeLog
PerformanceTests/Speedometer/resources/todomvc/vanilla-examples/vanillajs/index.html
PerformanceTests/Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/store.js
PerformanceTests/Speedometer/resources/todomvc/vanilla-examples/vanillajs/readme.md

index e2d9553..4bc82b0 100644 (file)
@@ -1,3 +1,17 @@
+2017-07-07  Mathias Bynens  <mathias@qiwi.be>
+
+        Speedometer 2.0: Fix vanilla JS example
+        https://bugs.webkit.org/show_bug.cgi?id=174246
+
+        Reviewed by Ryosuke Niwa.
+
+        Previously, all TODO items were assigned an ID of `null`. This patch
+        fixes that bug. Manually deleting items now works again.
+
+        * Speedometer/resources/todomvc/vanilla-examples/vanillajs/index.html: Made title consistent.
+        * Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/store.js: Fixed bug with deleting items.
+        * Speedometer/resources/todomvc/vanilla-examples/vanillajs/readme.md: Added docs.
+
 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
 
         [Cocoa] Improve performance of font lookups
index 6d944c4..f9e518d 100644 (file)
@@ -2,7 +2,7 @@
 <html lang="en" data-framework="javascript">
     <head>
         <meta charset="utf-8">
-        <title>VanillaJS â€¢ TodoMVC</title>
+        <title>Vanilla JavaScript TodoMVC example</title>
         <link rel="stylesheet" href="node_modules/todomvc-common/base.css">
         <link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
     </head>
index b520514..7b28ccd 100644 (file)
@@ -3,7 +3,7 @@
     'use strict';
 
     var MemoryStorage = {};
-    var id = 1;
+    var ID = 1;
 
     /**
      * Creates a new client side storage object and will create an empty
@@ -98,7 +98,7 @@
             callback.call(this, todos);
         } else {
             // Generate an ID
-            updateData.id = id++;
+            updateData.id = ID++;
 
             todos.push(updateData);
             MemoryStorage[this._dbName] = JSON.stringify(data);
index 2c7ac62..85e9a23 100644 (file)
@@ -1,5 +1,10 @@
-# Vanilla JavaScript TodoMVC Example
+# Speedometer 2.0: Vanilla JavaScript TodoMVC example
 
-> JavaScript® (often shortened to JS) is a lightweight, interpreted, object-oriented language with first-class functions, most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB.
+## Test locally
 
-> _[JavaScript - developer.mozilla.org](http://developer.mozilla.org/en-US/docs/JavaScript)
+1. Run a local server from this directory. (You could use [`npm i -g http-server`](https://github.com/indexzero/http-server).)
+2. Open the URL pointing to the local server in your web browser of choice.
+
+## Build
+
+There is no build step for this example.