OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 function debug(message) | 5 function debug(message) |
6 { | 6 { |
7 var span = document.createElement("span"); | 7 var span = document.createElement("span"); |
8 span.appendChild(document.createTextNode(message)); | 8 span.appendChild(document.createTextNode(message)); |
9 span.appendChild(document.createElement("br")); | 9 span.appendChild(document.createElement("br")); |
10 document.getElementById('status').appendChild(span); | 10 document.getElementById('status').appendChild(span); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 deleteRequest.onblocked = unexpectedBlockedCallback; | 140 deleteRequest.onblocked = unexpectedBlockedCallback; |
141 deleteRequest.onsuccess = function() { | 141 deleteRequest.onsuccess = function() { |
142 var openRequest = indexedDB.open(dbname); | 142 var openRequest = indexedDB.open(dbname); |
143 openRequest.onerror = unexpectedErrorCallback; | 143 openRequest.onerror = unexpectedErrorCallback; |
144 openRequest.onupgradeneeded = upgradeCallback; | 144 openRequest.onupgradeneeded = upgradeCallback; |
145 openRequest.onblocked = unexpectedBlockedCallback; | 145 openRequest.onblocked = unexpectedBlockedCallback; |
146 if (optionalOpenCallback) | 146 if (optionalOpenCallback) |
147 openRequest.onsuccess = optionalOpenCallback; | 147 openRequest.onsuccess = optionalOpenCallback; |
148 }; | 148 }; |
149 } | 149 } |
150 | |
151 if (typeof String.prototype.startsWith != 'function') { | |
jsbell
2014/03/26 18:16:58
Maybe add a comment that this is a (partial) polyf
jsbell
2014/03/26 18:16:58
Nit: !==
cmumford
2014/03/26 21:40:36
Really? I'll look into that. I can redo this to no
jsbell
2014/03/26 22:49:00
These days it's "bad form" on the Web to extend bu
| |
152 String.prototype.startsWith = function (str) { | |
153 return this.indexOf(str) == 0; | |
jsbell
2014/03/26 18:16:58
Nit: ===
| |
154 }; | |
155 } | |
OLD | NEW |