Skip to content

Commit

Permalink
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion corelib/opal/class.rb
Original file line number Diff line number Diff line change
@@ -177,7 +177,7 @@ def constants
else {
own_only = true;
var parent = #{self}._super;
while (parent !== Opal.Object) {
while (parent && (parent !== Opal.Object)) {
scopes.push(parent._scope);
parent = parent._super;
}
7 changes: 7 additions & 0 deletions spec/opal/class/constants_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'spec_helper'

describe "Class#constants" do
it "does not break on Object" do
Object.constants.should be_kind_of(Array)
end
end

0 comments on commit 022a6bc

Please sign in to comment.