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

Safely reference native keyword to fix compression #1621

Merged
merged 1 commit into from
Sep 27, 2017

Conversation

matthewlane
Copy link
Collaborator

@matthewlane matthewlane commented Sep 25, 2017

Type of change

  • Bugfix
  • Refactoring (no functional changes, no api changes)

Description of change

native is a reserved word in ECMAScript v3. Its presence as a variable name, object property, and function name within Prebid was causing some compression tools to crash. This PR changes variables and functions that were named native to something else, and switches object lookups for native properties from dot to bracket form.

Testing notes

Tested on macOS 10.12 with Java 8 and brew install yuicompressor

Built prebid with gulp serve than ran:

java -jar /usr/local/Cellar/yuicompressor/2.4.8/libexec/yuicompressor-2.4.8.jar build/dev/prebid.js > build/prebid.min.js

On master this produces errors, on this PR the compression is successful

Other information

Fixes #1471

@dbemiller dbemiller merged commit 6cf71d0 into master Sep 27, 2017
@dbemiller dbemiller deleted the bugfix/native-keyword-compression branch September 27, 2017 17:05
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compression failed with Yuicompressor & Closure
3 participants