Skip to content

Commit 9243370

Browse files
anmonteirodnolen
authored andcommitted
CLJS-2317: Upgrade Google Closure Library
1 parent 20a6e1f commit 9243370

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

pom.template.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<dependency>
3636
<groupId>org.clojure</groupId>
3737
<artifactId>google-closure-library</artifactId>
38-
<version>0.0-20170519-fa0499ef</version>
38+
<version>0.0-20170809-b9c14c6b</version>
3939
</dependency>
4040
<dependency>
4141
<groupId>org.clojure</groupId>

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[org.clojure/tools.reader "1.0.5"]
1414
[org.clojure/test.check "0.10.0-alpha2" :scope "test"]
1515
[com.cognitect/transit-clj "0.8.300"]
16-
[org.clojure/google-closure-library "0.0-20170519-fa0499ef"]
16+
[org.clojure/google-closure-library "0.0-20170809-b9c14c6b"]
1717
[com.google.javascript/closure-compiler-unshaded "v20170626"]
1818
[org.mozilla/rhino "1.7R5"]]
1919
:profiles {:1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}

script/bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CORE_SPECS_ALPHA_RELEASE="0.1.10"
88
CLOSURE_RELEASE="20170626"
99
DJSON_RELEASE="0.2.6"
1010
TRANSIT_RELEASE="0.8.300"
11-
GCLOSURE_LIB_RELEASE="0.0-20160609-f42b4a24"
11+
GCLOSURE_LIB_RELEASE="0.0-20170809-b9c14c6b"
1212
RHINO_RELEASE="1_7R5"
1313
TREADER_RELEASE="1.0.5"
1414
TEST_CHECK_RELEASE="0.10.0-alpha2"

src/main/cljs/cljs/bootstrap_node.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ global.goog = {};
5757
* @param {string} src The script source.
5858
* @return {boolean} True if the script was imported, false otherwise.
5959
*/
60-
global.CLOSURE_IMPORT_SCRIPT = function(src) {
60+
global.CLOSURE_IMPORT_SCRIPT = function(src, opt_sourceText) {
6161
// if CLJS_ROOT has been rewritten (by REPLs) need to compute require path
6262
// so we can delete the old entry from the Node.js require cache
6363
if(CLJS_ROOT !== ".") {
@@ -72,17 +72,33 @@ global.CLOSURE_IMPORT_SCRIPT = function(src) {
7272

7373
// Sources are always expressed relative to closure's base.js, but
7474
// require() is always relative to the current source.
75-
require(path.join(".", "..", src));
75+
if (opt_sourceText === undefined) {
76+
require(path.join(".", "..", src));
77+
} else {
78+
eval(opt_sourceText);
79+
}
7680
return true;
7781
};
7882

7983

84+
/**
85+
* Loads a file when using Closure's goog.require() API with goog.modules.
86+
*
87+
* @param {string} src The file source.
88+
* @return {string} The file contents.
89+
*/
90+
global.CLOSURE_LOAD_FILE_SYNC = function(src) {
91+
return fs.readFileSync(
92+
path.resolve(__dirname, '..', src), {encoding: 'utf-8'});
93+
};
94+
95+
8096
// Declared here so it can be used to require base.js
8197
function nodeGlobalRequire(file) {
8298
var _module = global.module, _exports = global.exports;
8399
global.module = undefined;
84100
global.exports = undefined;
85-
vm.runInThisContext(fs.readFileSync(file), file);
101+
vm.runInThisContext.call(global, fs.readFileSync(file), file);
86102
global.exports = _exports;
87103
global.module = _module;
88104
}

src/test/self/self_parity/auxiliary.cljs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
goog.iter.Iterator
8989
goog.json
9090
goog.json.EvalJsonProcessor
91-
goog.json.HybridJsonProcessor
9291
goog.json.NativeJsonProcessor
9392
goog.json.Replacer
9493
goog.json.Reviver
@@ -152,5 +151,4 @@
152151
goog.structs.StringSet
153152
goog.structs.TreeNode
154153
goog.structs.Trie
155-
goog.structs.weak
156154
goog.text.LoremIpsum))

0 commit comments

Comments
 (0)