aboutsummaryrefslogtreecommitdiff
path: root/src/library_browser.js
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2014-02-20 18:03:33 +0700
committerBruce Mitchener <bruce.mitchener@gmail.com>2014-02-21 07:42:28 +0700
commitd4edc4c8614d43d3b46c6d01bbc00bd00835587e (patch)
tree589cb32e668f556eb5a7855fc4a09744c8e09129 /src/library_browser.js
parent686d2e6a68f02da35a4fc4d71c5d152c7ed2d177 (diff)
strict fix: Don't define functions within conditionals or try blocks.
Diffstat (limited to 'src/library_browser.js')
-rw-r--r--src/library_browser.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library_browser.js b/src/library_browser.js
index 46082281..b800292c 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -234,6 +234,10 @@ mergeInto(LibraryManager.library, {
}
#endif
var ctx;
+ var errorInfo = '?';
+ function onContextCreationError(event) {
+ errorInfo = event.statusMessage || errorInfo;
+ }
try {
if (useWebGL) {
var contextAttributes = {
@@ -251,10 +255,6 @@ mergeInto(LibraryManager.library, {
contextAttributes.preserveDrawingBuffer = true;
#endif
- var errorInfo = '?';
- function onContextCreationError(event) {
- errorInfo = event.statusMessage || errorInfo;
- }
canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);
try {
['experimental-webgl', 'webgl'].some(function(webglId) {