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

NoMethodError: undefined method `start_with?' for nil:NilClass #177

Open
khoan opened this issue Sep 4, 2020 · 1 comment
Open

NoMethodError: undefined method `start_with?' for nil:NilClass #177

khoan opened this issue Sep 4, 2020 · 1 comment

Comments

@khoan
Copy link

khoan commented Sep 4, 2020

$ bin/bam
Uglifier version 4.1.11
#<NoMethodError: undefined method `start_with?' for nil:NilClass>
fail :(

$ cat bin/bam
#!/usr/bin/env ruby

require 'uglifier'

puts "Uglifier version #{Uglifier::VERSION}"
uglifier = Uglifier.new(harmony: true)
begin
  uglifier.compile(<<~EOSCRIPT)
function bam(sam) {
  sam = Object.assign({}, {error: 'wat'});
  const { error } = sam;
}
  EOSCRIPT
  puts 'ok'
rescue => e
  puts e.inspect
  puts 'fail :('
end

Thanks.

@ahorek
Copy link

ahorek commented Dec 8, 2020

harmony support is experimental and there're old bugs

try https://github.com/ahorek/terser-ruby

Terser version 1.1.1
function bam(r){r=Object.assign({},{error:"wat"});const{error:n}=r}
ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants