Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some closure compiler hacks #8437

Merged
merged 3 commits into from
Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/closure-defined-fs-annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ var Browser;
*/
var SDL;

/**
* @suppress {duplicate, undefinedVars}
*/
var GL;

/**
* @suppress {duplicate, undefinedVars}
*/
var GLctx;

/**
* @suppress {duplicate, undefinedVars}
*/
Expand Down
3 changes: 3 additions & 0 deletions src/library_glfw.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ var LibraryGLFW = {

event.preventDefault();

#if '$FS' in addedLibraryItems
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I didn't know about this "preprocessor syntax"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we made it possible to run arbitrary JS in the preprocessor, I think this was a few months ago.

var filenames = allocate(new Array(event.dataTransfer.files.length*4), 'i8*', ALLOC_NORMAL);
var filenamesArray = [];
var count = event.dataTransfer.files.length;
Expand Down Expand Up @@ -794,6 +795,8 @@ var LibraryGLFW = {
save(event.dataTransfer.files[i]);
}

#endif // '$FS' in addedLibraryItems

return false;
},

Expand Down
8 changes: 3 additions & 5 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -2378,12 +2378,10 @@ def closure_compiler(filename, pretty=True):

if not Settings.ASMFS:
# If we have filesystem disabled, tell Closure not to bark when there are syscalls emitted that still reference the nonexisting FS object.
if not Settings.FILESYSTEM:
CLOSURE_ANNOTATIONS += ['--js', path_from_root('src', 'closure-undefined-fs-annotation.js')]

# If we do have filesystem enabled, tell Closure not to bark when FS references different libraries that might not exist.
if Settings.FILESYSTEM and not Settings.ASMFS:
if Settings.FILESYSTEM:
CLOSURE_ANNOTATIONS += ['--js', path_from_root('src', 'closure-defined-fs-annotation.js')]
else:
CLOSURE_ANNOTATIONS += ['--js', path_from_root('src', 'closure-undefined-fs-annotation.js')]

# Closure externs file contains known symbols to be extern to the minification, Closure
# should not minify these symbol names.
Expand Down