Skip to content

Commit 6627a82

Browse files
Merge branch 'trunk' into bidi-map
2 parents 98cafd1 + 9b1e83c commit 6627a82

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

javascript/private/fragment.bzl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_binary", "closure_js_library")
22

3+
EXPORT_FUNCTION_NAME = "se_exportedFunctionSymbol"
4+
35
def _internal_closure_fragment_export_impl(ctx):
46
ctx.actions.write(
57
output = ctx.outputs.out,
68
content = """
79
goog.require('%s');
8-
goog.exportSymbol('_', %s);
9-
""" % (ctx.attr.module, ctx.attr.function),
10+
goog.exportSymbol('%s', %s);
11+
""" % (ctx.attr.module, EXPORT_FUNCTION_NAME, ctx.attr.function),
1012
)
1113

1214
_internal_closure_fragment_export = rule(
@@ -59,10 +61,7 @@ def closure_fragment(
5961
# See http://code.google.com/p/selenium/issues/detail?id=1333
6062
wrapper = (
6163
"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);}"
64+
"return (function(){%output%; return this." + EXPORT_FUNCTION_NAME + ".apply(null,arguments);}).apply(window, arguments);}"
6665
)
6766

6867
browser_defs = {

0 commit comments

Comments
 (0)