forked from dcodeIO/long.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial and (more) recent goog.math.long for reference, see dcode…
- Loading branch information
Showing
9 changed files
with
4,224 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Closure Library compatibility layer | ||
|
||
if (typeof global === "undefined") global = window; | ||
|
||
var goog = global.goog = {}; | ||
|
||
goog.require = function(pkg) {}; | ||
|
||
goog.setTestOnly = function() {}; | ||
|
||
goog.provide = function(pkg) { | ||
var parts = pkg.split('.'); | ||
var current = global; | ||
while (parts.length) { | ||
var part = parts.shift(); | ||
current = current[part] || (current[part] = {}); | ||
} | ||
}; | ||
|
||
// Environment required to test both old and new versions of goog.math.long.js | ||
|
||
goog.provide("goog.global"); | ||
|
||
goog.provide("goog.asserts"); | ||
|
||
goog.asserts.assert = function(condition, opt_message, var_args) { | ||
if (!condition) | ||
throw Error("Assertion error: " + opt_message + " " + Array.prototype.slice.call(arguments, 2)); | ||
}; | ||
|
||
global.assertEquals = function(expected, actual) { goog.asserts.assert(expected === actual); } | ||
|
||
global.assertTrue = function(value) { goog.asserts.assert(value === true); } | ||
|
||
goog.provide("goog.reflect"); | ||
|
||
goog.reflect.cache = function(cacheObj, key, valueFn, opt_keyFn) { | ||
var storedKey = opt_keyFn ? opt_keyFn(key) : key; | ||
if (Object.prototype.hasOwnProperty.call(cacheObj, storedKey)) { | ||
return cacheObj[storedKey]; | ||
} | ||
return (cacheObj[storedKey] = valueFn(key)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require("./base"); | ||
|
||
require("./initial/long"); | ||
require("./initial/long_test"); | ||
|
||
console.log("Testing initial goog.math.long.js ..."); | ||
Object.keys(goog.global).forEach(function(key) { | ||
if (typeof goog.global[key] === "function") { | ||
console.log("Running '" + key + "' ..."); | ||
goog.global[key](); | ||
} | ||
}); | ||
goog.global = {}; | ||
|
||
require("./recent/long"); | ||
require("./recent/long_test"); | ||
|
||
console.log("\nTesting (more) recent goog.math.long.js ..."); | ||
Object.keys(goog.global).forEach(function(key) { | ||
if (typeof goog.global[key] === "function") { | ||
console.log("Running '" + key + "' ..."); | ||
goog.global[key](); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
goog.math.long at the time of bootstrapping long.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
goog.math.long at 2018/02/03 |
Oops, something went wrong.