Skip to content

Commit c39c7fb

Browse files
[JS] [atoms] update fragment wrapper to apply window object to fragments (#12557)
fix #12549 Co-authored-by: David Burns <[email protected]>
1 parent 5230208 commit c39c7fb

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

javascript/private/fragment.bzl

+3-10
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,11 @@ def closure_fragment(
5151

5252
# Wrap the output in two functions. The outer function ensures the
5353
# compiled fragment never pollutes the global scope by using its
54-
# own scope on each invocation. We must import window.navigator into
55-
# this unique scope since Closure's goog.userAgent package assumes
56-
# navigator and document are defined on goog.global. Normally, this
57-
# would be window, but we are explicitly defining the fragment so that
58-
# goog.global is _not_ window.
59-
# See http://code.google.com/p/selenium/issues/detail?id=1333
54+
# own scope on each invocation.
6055
wrapper = (
6156
"function(){" +
62-
"return (function(){%output%; return this._.apply(null,arguments);}).apply({" +
63-
"navigator:typeof window!='undefined'?window.navigator:null," +
64-
"document:typeof window!='undefined'?window.document:null" +
65-
"}, arguments);}"
57+
"return (function(){%output%; return this._.apply(null,arguments);}).apply(" +
58+
"window, arguments);}"
6659
)
6760

6861
browser_defs = {

0 commit comments

Comments
 (0)