Skip to content

Instantly share code, notes, and snippets.

@RobertFischer
Created June 27, 2014 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertFischer/ac75c60542b5e534c069 to your computer and use it in GitHub Desktop.
Save RobertFischer/ac75c60542b5e534c069 to your computer and use it in GitHub Desktop.
Who needs static typing when we can roll our own?
# Starts on line 91 in uglifier-2.5.0
# Initialize new context for Uglifier with given options
#
# options - Hash of options to override Uglifier::DEFAULTS
def initialize(options = {})
(options.keys - DEFAULTS.keys - [:comments, :squeeze, :copyright])[0..1].each do |missing|
raise ArgumentError.new("Invalid option: #{missing}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment