mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-25 11:37:43 -10:00
Bug 1312236 updated React to v15.3.2 which was making webconsole's mocha test fail. An error was thrown because the path and export we do in requireHelper to make enzyme able to call React functions was changed. We fix the require to ReactDOM by using the react-dom.js file, and we add the similar react-dom-server.js for ReactDOMServer functions. Tests now run like they used to. MozReview-Commit-ID: GXIQJPlqp4A
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
/**
|
|
* ReactDOMServer v15.3.2
|
|
*
|
|
* Copyright 2013-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
*/
|
|
// Based off https://github.com/ForbesLindesay/umd/blob/master/template.js
|
|
;(function(f) {
|
|
// CommonJS
|
|
if (typeof exports === "object" && typeof module !== "undefined") {
|
|
module.exports = f(require('react'));
|
|
|
|
// RequireJS
|
|
} else if (typeof define === "function" && define.amd) {
|
|
define(['react'], f);
|
|
|
|
// <script>
|
|
} else {
|
|
var g;
|
|
if (typeof window !== "undefined") {
|
|
g = window;
|
|
} else if (typeof global !== "undefined") {
|
|
g = global;
|
|
} else if (typeof self !== "undefined") {
|
|
g = self;
|
|
} else {
|
|
// works providing we're not in "use strict";
|
|
// needed for Java 8 Nashorn
|
|
// see https://github.com/facebook/react/issues/3037
|
|
g = this;
|
|
}
|
|
g.ReactDOMServer = f(g.React);
|
|
}
|
|
|
|
})(function(React) {
|
|
return React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
});
|