File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
3- var sourceFile = window . location . search . match ( / [ ? & ] s o u r c e F i l e = ( [ ^ & ] + ) / ) ;
4-
5- if ( ! sourceFile ) {
6- sourceFile = '../../packages/node_modules/pouchdb/dist/pouchdb.js' ;
7- } else {
8- sourceFile = '../../packages/node_modules/pouchdb/dist/' + sourceFile [ 1 ] ;
9- }
10-
113// only running in Chrome and Firefox due to various bugs.
124// IE: https://connect.microsoft.com/IE/feedback/details/866495
135// Safari: doesn't have IndexedDB or WebSQL in a WW
@@ -16,9 +8,9 @@ if (!sourceFile) {
168var isNodeWebkit = typeof window !== 'undefined' &&
179 typeof process !== 'undefined' ;
1810
19- if ( typeof window . Worker === 'function' &&
11+ if ( ( window && typeof window . Worker === 'function' ) &&
2012 ! isNodeWebkit && ! testUtils . isIE ( ) &&
21- ( window . chrome || / F i r e f o x / . test ( navigator . userAgent ) ) ) {
13+ ( ( window && window . chrome ) || ( navigator && / F i r e f o x / . test ( navigator . userAgent ) ) ) ) {
2214 runTests ( ) ;
2315}
2416
@@ -28,6 +20,15 @@ function runTests() {
2820
2921 before ( function ( ) {
3022 worker = new Worker ( 'worker.js' ) ;
23+
24+ var sourceFile = window && window . location . search . match ( / [ ? & ] s o u r c e F i l e = ( [ ^ & ] + ) / ) ;
25+
26+ if ( ! sourceFile ) {
27+ sourceFile = '../../packages/node_modules/pouchdb/dist/pouchdb.js' ;
28+ } else {
29+ sourceFile = '../../packages/node_modules/pouchdb/dist/' + sourceFile [ 1 ] ;
30+ }
31+
3132 worker . postMessage ( [ 'source' , sourceFile ] ) ;
3233 } ) ;
3334
You can’t perform that action at this time.
0 commit comments