File tree 1 file changed +6
-9
lines changed
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
1
/** @module pbjs */
2
-
2
+ // if pbjs already exists in global dodcument scope, use it, if not, create the object
3
+ window . pbjs = ( window . pbjs || { } ) ;
4
+ window . pbjs . que = window . pbjs . que || [ ] ;
5
+ var pbjs = window . pbjs ;
3
6
var CONSTANTS = require ( './constants.json' ) ;
4
7
var utils = require ( './utils.js' ) ;
5
8
var bidmanager = require ( './bidmanager.js' ) ;
@@ -13,14 +16,11 @@ var objectType_object = 'object';
13
16
var objectType_string = 'string' ;
14
17
var objectType_number = 'number' ;
15
18
16
- //if pbjs already exists in global dodcument scope, use it, if not, create the object
17
- pbjs = typeof pbjs !== objectType_undefined ? pbjs : { } ;
18
-
19
19
var pb_preBidders = [ ] ,
20
20
pb_placements = [ ] ,
21
21
pb_bidderMap = { } ,
22
22
pb_targetingMap = { } ;
23
-
23
+
24
24
25
25
/* Public vars */
26
26
//default timeout for all bids
@@ -30,9 +30,6 @@ pbjs.logging = pbjs.logging || false;
30
30
//let the world know we are loaded
31
31
pbjs . libLoaded = true ;
32
32
33
- //if pbjs.anq command queue already exists, use it, if not create it
34
- pbjs . que = pbjs . que || [ ] ;
35
-
36
33
//create adUnit array
37
34
pbjs . adUnits = pbjs . adUnits || [ ] ;
38
35
@@ -668,4 +665,4 @@ pbjs.removeCallback = function(cbId) {
668
665
//todo
669
666
} ;
670
667
671
- processQue ( ) ;
668
+ processQue ( ) ;
You can’t perform that action at this time.
0 commit comments