Skip to content

Commit fe69b5b

Browse files
ahalbrockharsha509AutomatedTester
authored andcommitted
Issue 12549 fix atoms generation lowdash (SeleniumHQ#15247)
* Updating the atom frament bazel file so that "_" is not used as the exported function, also passing in entire window so that all pieces should have access to what they need. * Added the exported function name to the string substitution list. Atoms build now. * Properly adding the exported function variable to the wrapper. * Updated exported symbol to relate to selenium for namespacing purposes, updating single quotes to to double for linting check. --------- Co-authored-by: Sri Harsha <[email protected]> Co-authored-by: David Burns <[email protected]>
1 parent 705f417 commit fe69b5b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

javascript/private/fragment.bzl

+5-6
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)