Permalink
Browse files

Properly exclude browserify's annoying _process, again, fixes #502

  • Loading branch information...
dcodeIO committed Nov 29, 2016
1 parent 3c16e46 commit 51fe45656b530efbba6dad92f92db2300aa18761

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
BIN -21 Bytes (100%) dist/protobuf.min.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -104,7 +104,7 @@ RootPrototype.load = function load(filename, callback) {
// Fetches a single file
function fetch(filename, weak) {
// Check if this file references a bundled definition
// Strip path if this file references a bundled definition
var idx = filename.indexOf("google/protobuf/");
if (idx > -1) {
var altname = filename.substring(idx);
@@ -15,7 +15,7 @@ util.codegen = require("./util/codegen");
* @memberof util
* @type {boolean}
*/
var isNode = util.isNode = Boolean(typeof process !== 'undefined' && process.versions && process.versions.node);
var isNode = util.isNode = Boolean(global.process && global.process.versions && global.process.versions.node);
/**
* Optional buffer class to use.
@@ -356,14 +356,14 @@ WriterPrototype.bytes = function write_bytes(value) {
};
function writeString(buf, pos, val) {
for (var i = 0, len = val.length, c1, c2; i < len; ++i) {
c1 = val.charCodeAt(i);
for (var i = 0; i < val.length; ++i) {
var c1 = val.charCodeAt(i), c2;
if (c1 < 128) {
buf[pos++] = c1;
} else if (c1 < 2048) {
buf[pos++] = c1 >> 6 | 192;
buf[pos++] = c1 & 63 | 128;
} else if ((c1 & 0xFC00) === 0xD800 && i + 1 < len && ((c2 = val.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
} else if ((c1 & 0xFC00) === 0xD800 && i + 1 < val.length && ((c2 = val.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
++i;
buf[pos++] = c1 >> 18 | 240;
@@ -0,0 +1,5 @@
<html>
<head>
<script src="../dist/protobuf.js"></script>
</head>
</html>

0 comments on commit 51fe456

Please sign in to comment.