Skip to content

Commit

Permalink
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion corelib/class.rb
Original file line number Diff line number Diff line change
@@ -4,9 +4,11 @@ def self.new(sup = Object, &block)
function AnonClass(){};
var klass = Opal.boot(sup, AnonClass)
klass._name = nil;
klass._scope = sup._scope;
klass.__parent = sup;
// inherit scope from parent
$opal.create_scope(sup._scope, klass);
sup.$inherited(klass);
if (block !== nil) {
2 changes: 2 additions & 0 deletions corelib/runtime.js
Original file line number Diff line number Diff line change
@@ -84,6 +84,8 @@
}
}

Opal.create_scope = create_scope;

/*
* A `class Foo; end` expression in ruby is compiled to call this runtime
* method which either returns an existing class of the given name, or creates

0 comments on commit 56879e0

Please sign in to comment.