Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b6082f91283c
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ec07a03ba333
Choose a head ref
  • 7 commits
  • 2 files changed
  • 2 contributors

Commits on Oct 8, 2015

  1. Copy the full SHA
    73ec278 View commit details

Commits on Oct 11, 2015

  1. Merge in master

    wied03 committed Oct 11, 2015
    Copy the full SHA
    0d8508a View commit details
  2. Undo previous change

    wied03 committed Oct 11, 2015
    Copy the full SHA
    8d6b98a View commit details
  3. White space

    wied03 committed Oct 11, 2015
    Copy the full SHA
    57521cd View commit details
  4. Undo rubyspec downgrade

    wied03 committed Oct 11, 2015
    Copy the full SHA
    1c80167 View commit details

Commits on Oct 12, 2015

  1. Copy the full SHA
    d498487 View commit details
  2. Merge pull request #1136 from wied03/operator_stubs

    Test and add support for operator method missing
    elia committed Oct 12, 2015
    Copy the full SHA
    ec07a03 View commit details
Showing with 11 additions and 2 deletions.
  1. +2 −1 CHANGELOG.md
  2. +9 −1 spec/lib/compiler_spec.rb
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -26,7 +26,8 @@

* Newly compliant with RubySpec:
* `Enumerable#chunk`


* Operator methods (e.g. `+`, `<`, etc.) can be handled by `method_missing`

## 0.8.0 2015-07-16

10 changes: 9 additions & 1 deletion spec/lib/compiler_spec.rb
Original file line number Diff line number Diff line change
@@ -38,7 +38,15 @@
expect_compiled("self.inspect").to include("$inspect()")
expect_compiled("self.map { |a| a + 10 }").to include("$map")
end


it "adds method missing stubs" do
expect_compiled("self.puts 'hello'").to include("Opal.add_stubs(['$puts'])")
end

it 'adds method missing stubs with operators' do
expect_compiled("class Foo; end; Foo.new > 5").to include("Opal.add_stubs(['$>', '$new'])")
end

it "should compile constant lookups" do
expect_compiled("Object").to include("Object")
expect_compiled("Array").to include("Array")