mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-03 04:32:27 +00:00
Undo PR: make flatbuffers.js into a UMD module (#4228)
This PR did not work in all JS environments and caused downstream breakage. Change-Id: Ib565129e26622d02bad2d45816bd05f6b961b994
This commit is contained in:
@@ -3,14 +3,18 @@
|
|||||||
/// @{
|
/// @{
|
||||||
/// @cond FLATBUFFERS_INTERNAL
|
/// @cond FLATBUFFERS_INTERNAL
|
||||||
|
|
||||||
(function (global, factory) {
|
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = { flatbuffers: factory() } :
|
|
||||||
typeof define === 'function' && define.amd ? define(factory) :
|
|
||||||
(global.flatbuffers = factory());
|
|
||||||
}(this, (function () { 'use strict';
|
|
||||||
/**
|
/**
|
||||||
* @exports flatbuffers
|
* @fileoverview
|
||||||
*/
|
*
|
||||||
|
* Need to suppress 'global this' error so the Node.js export line doesn't cause
|
||||||
|
* closure compile to error out.
|
||||||
|
* @suppress {globalThis}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @namespace
|
||||||
|
*/
|
||||||
var flatbuffers = {};
|
var flatbuffers = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1185,9 +1189,8 @@ flatbuffers.ByteBuffer.prototype.createLong = function(low, high) {
|
|||||||
return flatbuffers.Long.create(low, high);
|
return flatbuffers.Long.create(low, high);
|
||||||
};
|
};
|
||||||
|
|
||||||
return flatbuffers;
|
// Exports for Node.js and RequireJS
|
||||||
|
this.flatbuffers = flatbuffers;
|
||||||
})));
|
|
||||||
|
|
||||||
/// @endcond
|
/// @endcond
|
||||||
/// @}
|
/// @}
|
||||||
|
|||||||
Reference in New Issue
Block a user