Skip to content

Commit

Permalink
Added _pbjsGlobals for tracking renames. Resolves #4254 (#4419)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkendall07 authored and msm0504 committed Nov 20, 2019
1 parent f82d541 commit f1c7972
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/prebidGlobal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ window.$$PREBID_GLOBAL$$ = (window.$$PREBID_GLOBAL$$ || {});
window.$$PREBID_GLOBAL$$.cmd = window.$$PREBID_GLOBAL$$.cmd || [];
window.$$PREBID_GLOBAL$$.que = window.$$PREBID_GLOBAL$$.que || [];

// create a pbjs global pointer
window._pbjsGlobals = window._pbjsGlobals || [];
window._pbjsGlobals.push('$$PREBID_GLOBAL$$');

export function getGlobal() {
return window.$$PREBID_GLOBAL$$;
}
4 changes: 4 additions & 0 deletions test/spec/api_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ describe('Publisher API', function () {
it('should have $$PREBID_GLOBAL$$.que.push function', function () {
assert.isFunction($$PREBID_GLOBAL$$.que.push);
});

it('should have global pointer for PBJS global', function () {
assert.isArray(window._pbjsGlobals);
});
});

describe('has function', function () {
Expand Down

0 comments on commit f1c7972

Please sign in to comment.