2016-11-22 01:23:53 +00:00
|
|
|
/* Copyright 2016 Mozilla
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
|
|
* this file except in compliance with the License. You may obtain a copy of the
|
|
|
|
* License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* Unless required by applicable law or agreed to in writing, software distributed
|
|
|
|
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
|
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
|
|
* specific language governing permissions and limitations under the License.
|
|
|
|
*/
|
2016-07-06 01:13:29 +00:00
|
|
|
|
2016-11-22 01:51:52 +00:00
|
|
|
// Datomish 0.3.0
|
2016-07-06 01:13:29 +00:00
|
|
|
|
|
|
|
(function (definition) {
|
|
|
|
// This file will function properly as a <script> tag, or a module
|
|
|
|
// using CommonJS and NodeJS or RequireJS module formats.
|
|
|
|
|
|
|
|
// Wrapper gratefully adapted from:
|
|
|
|
// https://github.com/kriskowal/q/blob/v1/q.js
|
|
|
|
// https://github.com/swannodette/mori/blob/master/support/wrapper.js
|
|
|
|
// https://github.com/tonsky/datascript/blob/master/release-js/wrapper.js
|
|
|
|
|
|
|
|
// CommonJS
|
|
|
|
if (typeof exports === "object") {
|
|
|
|
module.exports = definition();
|
|
|
|
|
|
|
|
// RequireJS
|
|
|
|
} else if (typeof define === "function" && define.amd) {
|
|
|
|
define(definition);
|
|
|
|
|
|
|
|
// <script>
|
|
|
|
} else {
|
2016-07-08 18:23:04 +00:00
|
|
|
datomish = definition();
|
2016-07-06 01:13:29 +00:00
|
|
|
}
|
|
|
|
})(function () {
|
|
|
|
return function () {
|
2016-09-08 17:01:59 +00:00
|
|
|
|
|
|
|
// Monkeypatch setTimeout so that the Closure Compiler
|
|
|
|
// output can use it in a Sandbox context.
|
|
|
|
var { setTimeout } = require("sdk/timers");
|
|
|
|
this.setTimeout = setTimeout;
|