Skip to content

Commit

Permalink
include sodiumutil only when needed (emscripten-core#5296)
Browse files Browse the repository at this point in the history
  • Loading branch information
buu700 committed Jun 15, 2017
1 parent 8b7ac98 commit 337fe83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/jsifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ function JSify(data, functionsOnly) {
if (mainPass) {
var shellFile = SHELL_FILE ? SHELL_FILE : (BUILD_AS_SHARED_LIB || SIDE_MODULE ? 'shell_sharedlib.js' : 'shell.js');

var thirdPartyFiles = ['../third_party/sodiumutil/dist/sodiumutil.js'];
var thirdPartyFiles = [];

if (INCLUDE_THIRD_PARTY_SODIUMUTIL) {
thirdPartyFiles.push('../third_party/sodiumutil/dist/sodiumutil.js');
}

// We will start to print out the data, but must do so carefully - we are
// dealing with potentially *huge* strings. Convenient replacements and
Expand Down
1 change: 1 addition & 0 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -2281,6 +2281,7 @@ def to_nice_ident(ident): # limited version of the JS function toNiceIdent
@staticmethod
def get_subresource_location(path, data_uri=Settings.SINGLE_FILE):
if data_uri:
Settings.INCLUDE_THIRD_PARTY_SODIUMUTIL = 1
f = open(path, 'rb')
data = base64.b64encode(f.read())
f.close()
Expand Down

0 comments on commit 337fe83

Please sign in to comment.