-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bootstrapped compiler error messages regressed
The exception started slipping through the rescue in compiler.rb Ultimately that needs to be fixed (along with validating whether SyntaxError or RuntimeError should be what's raised). For now, make the compiler specs runnable in Opal and filter what does not currently pass (regex, __FILE__ issues) Add matchers to fill in for RSpec, stub out RSpec helper, fix not_to bridge Apply change/test from opal#1075
- Loading branch information
Showing
8 changed files
with
85 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
opal_filter "compiler (opal)" do | ||
fails 'Opal::Compiler should compile undef calls' | ||
fails 'Opal::Compiler method names when function name is reserved generates a valid named function for method' | ||
fails 'Opal::Compiler pre-processing require-ish methods #require_relative parses and resolve #require_relative argument' | ||
fails 'Opal::Compiler pre-processing require-ish methods #require_tree parses and resolve #require argument' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'spec_helper' | ||
require 'source_map' | ||
|
||
describe 'SourceMap::VLQ' do | ||
it 'encodes properly' do | ||
SourceMap::VLQ.encode([0]).should == 'A' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
module MatchHelpers | ||
class MatchMatcher | ||
def initialize(expected) | ||
fail "Expected #{expected} to be a Regexp!" unless expected.is_a?(Regexp) | ||
@expected = expected | ||
end | ||
|
||
def matches?(actual) | ||
@actual = actual | ||
@expected.match(@actual) | ||
end | ||
|
||
def failure_message | ||
["Expected #{@actual.inspect} (#{@actual.class})", | ||
"to match #{@expected}"] | ||
end | ||
|
||
def negative_failure_message | ||
["Expected #{@actual.inspect} (#{@actual.class})", | ||
"not to match #{@expected}"] | ||
end | ||
end | ||
|
||
class EndWithHelper | ||
def initialize(expected) | ||
@expected = expected | ||
end | ||
|
||
def matches?(actual) | ||
@actual = actual | ||
@actual.end_with?(@expected) | ||
end | ||
|
||
def failure_message | ||
["Expected #{@actual.inspect} (#{@actual.class})", | ||
"to end with #{@expected}"] | ||
end | ||
|
||
def negative_failure_message | ||
["Expected #{@actual.inspect} (#{@actual.class})", | ||
"not to end with #{@expected}"] | ||
end | ||
end | ||
end | ||
|
||
if !defined? RSpec | ||
class Object | ||
def match(expected) | ||
MatchHelpers::MatchMatcher.new(expected) | ||
end | ||
|
||
def end_with(expected) | ||
MatchHelpers::EndWithHelper.new(expected) | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters