Skip to content

Commit

Permalink
Probably the worst form of hiding require programmatically, see #527
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 8, 2016
1 parent 4462d8b commit 9bdec62
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
8 changes: 3 additions & 5 deletions dist/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/protobuf.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/protobuf.min.js

Large diffs are not rendered by default.

Binary file modified dist/protobuf.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/protobuf.min.js.map

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ util.asPromise = asPromise;
function fetch(path, callback) {
if (!callback)
return asPromise(fetch, util, path);
var fs; try { fs = Function('r', 'return r("fs")')(require); } catch (e) { } // eslint-disable-line no-new-func, no-empty
if (fs && fs.readFile)
return fs.readFile(path, "utf8", callback);
try { return eval(['req','uire'].join(''))("fs").readFile(path, "utf8", callback); } catch (e) { } // eslint-disable-line no-empty, no-eval
var xhr = new XMLHttpRequest();
function onload() {
if (xhr.status !== 0 && xhr.status !== 200)
Expand Down

0 comments on commit 9bdec62

Please sign in to comment.