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: 403b0b16126a
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7df8a6b1a915
Choose a head ref
  • 2 commits
  • 7 files changed
  • 1 contributor

Commits on Nov 28, 2013

  1. Copy the full SHA
    202409a View commit details
  2. Copy the full SHA
    7df8a6b View commit details
2 changes: 2 additions & 0 deletions lib/opal/parser.rb
Original file line number Diff line number Diff line change
@@ -506,6 +506,8 @@ def new_gettable(ref)
s(:gvar, ref[1])
when :cvdecl
s(:cvar, ref[1])
when :cdecl
s(:const, ref[1])
else
raise "Bad new_gettable ref: #{ref.type}"
end
3 changes: 3 additions & 0 deletions opal/corelib/module.rb
Original file line number Diff line number Diff line change
@@ -449,6 +449,9 @@ def private_method_defined?(obj)
false
end

def private_constant(*)
end

alias protected_method_defined? private_method_defined?

alias public_instance_methods instance_methods
27 changes: 27 additions & 0 deletions spec/opal/filters/bugs/language.rb
Original file line number Diff line number Diff line change
@@ -12,6 +12,12 @@
fails "The unpacking splat operator (*) unpacks the start and count arguments in an array slice assignment"
fails "The unpacking splat operator (*) unpacks arguments as if they were listed statically"

fails "The BEGIN keyword runs in a shared scope"
fails "The BEGIN keyword accesses variables outside the eval scope"
fails "The BEGIN keyword must appear in a top-level context"
fails "The BEGIN keyword runs first in a given code unit"
fails "The BEGIN keyword runs multiple begins in FIFO order"

fails "A block arguments with _ assigns the first variable named"
fails "A block arguments with _ extracts arguments with _"
fails "A block taking |*a| arguments does not call #to_ary to convert a single yielded object to an Array"
@@ -97,6 +103,27 @@
fails "A class definition stores instance variables defined in the class body in the class object"
fails "Reopening a class adds new methods to subclasses"

fails "Constant resolution within methods with ||= assignes constant if previously undefined"
fails "Constant resolution within methods with dynamically assigned constants does not search the lexical scope of qualifying modules"
fails "Constant resolution within methods with dynamically assigned constants returns the updated value when a constant is reassigned"
fails "Constant resolution within methods with dynamically assigned constants searches Object as a lexical scope only if Object is explicitly opened"
fails "Constant resolution within methods with dynamically assigned constants searches the superclass chain"
fails "Constant resolution within methods with dynamically assigned constants searches a module included in the superclass"
fails "Constant resolution within methods with dynamically assigned constants searches the superclass before a module included in the superclass"
fails "Constant resolution within methods with statically assigned constants does not search the lexical scope of qualifying modules"
fails "Constant resolution within methods with statically assigned constants searches Object as a lexical scope only if Object is explicitly opened"
fails "Constant resolution within methods with statically assigned constants searches the lexical scope of the method not the receiver's immediate class"
fails "Constant resolution within methods sends #const_missing to the original class or module scope"
fails "Literal (A::X) constant resolution with dynamically assigned constants evaluates the right hand side before evaluating a constant path"
fails "Literal (A::X) constant resolution with dynamically assigned constants does not search the singleton class of the class or module"
fails "Literal (A::X) constant resolution with dynamically assigned constants searches the superclass chain"
fails "Literal (A::X) constant resolution with dynamically assigned constants searches a module included in the superclass"
fails "Literal (A::X) constant resolution with dynamically assigned constants searches the superclass before a module included in the superclass"
fails "Literal (A::X) constant resolution with dynamically assigned constants searches a module included in the immediate class before the superclass"
fails "Literal (A::X) constant resolution with statically assigned constants does not search the singleton class of the class or module"
fails "Literal (A::X) constant resolution raises a TypeError if a non-class or non-module qualifier is given"


fails "The def keyword within a closure looks outside the closure for the visibility"
fails "a method definition that sets more than one default parameter all to the same value treats the argument after the multi-parameter normally"
fails "a method definition that sets more than one default parameter all to the same value only allows overriding the default value of the first such parameter in each set"
9 changes: 9 additions & 0 deletions spec/opal/filters/unsupported/encoding.rb
Original file line number Diff line number Diff line change
@@ -38,4 +38,13 @@
fails "String#split with Regexp returns an ArgumentError if an invalid UTF-8 string is supplied"

fails "String#upcase is locale insensitive (only replaces a-z)"

# language/magic_comment_spec
fails "Magic comment can take vim style"
fails "Magic comment can take Emacs style"
fails "Magic comment can be after the shebang"
fails "Magic comment must be the first token of the line"
fails "Magic comment must be at the first line"
fails "Magic comment is case-insensitive"
fails "Magic comment determines __ENCODING__"
end
30 changes: 30 additions & 0 deletions spec/opal/filters/unsupported/private_constants.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
opal_filter "{private,public,protected}_constant" do
fails "Module#public_constant marked constants in Object is defined? using ::Const form"
fails "Module#public_constant marked constants in Object can be accessed using ::Const form"
fails "Module#public_constant marked constants in a class is defined? with A::B form"
fails "Module#public_constant marked constants in a class can be accessed from outside the class"
fails "Module#public_constant marked constants in a module is defined? with A::B form"
fails "Module#public_constant marked constants in a module can be accessed from outside the module"
fails "Module#private_constant marked constants in Object is defined? through the normal search"
fails "Module#private_constant marked constants in Object is not defined? using ::Const form"
fails "Module#private_constant marked constants in Object cannot be accessed using ::Const form"
fails "Module#private_constant marked constants in a class is defined? from subclasses"
fails "Module#private_constant marked constants in a class is defined? from lexical scope"
fails "Module#private_constant marked constants in a class can be accessed from lexical scope"
fails "Module#private_constant marked constants in a class is defined? from the class itself"
fails "Module#private_constant marked constants in a class can be accessed from the class itself"
fails "Module#private_constant marked constants in a class is not defined? with A::B form"
fails "Module#private_constant marked constants in a class cannot be reopened as a class"
fails "Module#private_constant marked constants in a class cannot be reopened as a module"
fails "Module#private_constant marked constants in a class cannot be accessed from outside the class"
fails "Module#private_constant marked constants in a module is defined? from classes that include the module"
fails "Module#private_constant marked constants in a module is defined? from lexical scope"
fails "Module#private_constant marked constants in a module can be accessed from lexical scope"
fails "Module#private_constant marked constants in a module is defined? from the module itself"
fails "Module#private_constant marked constants in a module can be accessed from the module itself"
fails "Module#private_constant marked constants in a module is not defined? with A::B form"
fails "Module#private_constant marked constants in a module cannot be reopened as a class"
fails "Module#private_constant marked constants in a module cannot be reopened as a module"
fails "Module#private_constant marked constants in a module cannot be accessed from outside the module"
fails "Module#private_constant marked constants remain private even when updated"
end
6 changes: 6 additions & 0 deletions spec/opal/filters/unsupported/private_methods.rb
Original file line number Diff line number Diff line change
@@ -28,4 +28,10 @@

fails "Singleton.allocate is a private method"
fails "Singleton.new is a private method"

fails "The private keyword changes the visibility of the existing method in the subclass"
fails "The private keyword changes visiblity of previously called methods with same send/call site"
fails "The private keyword changes visibility of previously called method"
fails "The private keyword is overridden when a new class is opened"
fails "The private keyword marks following methods as being private"
end
38 changes: 19 additions & 19 deletions spec/opal/rubyspecs
Original file line number Diff line number Diff line change
@@ -338,57 +338,57 @@ core/time/strftime_spec
core/regexp/match_spec
#core/regexp/quote_spec

# language/BEGIN_spec
language/BEGIN_spec
language/alias_spec
language/and_spec
language/array_spec
# language/block_spec
# language/block_spec - can't parse |(a, (b, c))| args, or |a, b; c, d|
language/break_spec
language/case_spec
language/class_spec
language/class_variable_spec
# language/constants_spec
language/constants_spec
language/def_spec
language/defined_spec
# language/encoding_spec
# language/encoding_spec - can't parse encodings
language/ensure_spec
# language/execution_spec
# language/file_spec
# language/for_spec
# language/execution_spec - can't parse x-strings with shell commands
# language/file_spec - $LOADED_FEATURES not present
# language/for_spec - can't parse for-in expressions
language/hash_spec
language/if_spec
# language/line_spec
# language/line_spec - $LOADED_FEATURES not present
language/literal_lambda_spec
language/loop_spec
# language/magic_comment_spec
language/magic_comment_spec
language/match_spec
language/metaclass_spec
language/module_spec
language/next_spec
language/not_spec
# language/numbers_spec
# language/numbers_spec - can't parse numbers using control characters
language/or_spec
language/order_spec
language/precedence_spec
# language/predefined_spec
# language/private_spec
# language/proc_spec
# language/predefined_spec - ruby_exe() specs all failing
language/private_spec
# language/proc_spec - javascript Parse error
language/redo_spec
# language/regexp_spec
# language/regexp_spec - invalid javascript Regexp
language/rescue_spec
language/retry_spec
language/return_spec
language/send_spec
language/singleton_class_spec
# language/splat_spec
# language/string_spec
# language/splat_spec - can't parse all splats
# language/string_spec - can't parse strings using control-characters
language/super_spec
# language/symbol_spec
# language/throw_spec
# language/symbol_spec - lots fail
# language/throw_spec - unsupported
language/undef_spec
language/unless_spec
language/until_spec
# language/variables_spec
# language/variables_spec - can't parse whole file
language/while_spec
language/yield_spec