Skip to content

Commit

Permalink
Remove no_block_given helper from runtime, no longer used
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Aug 4, 2013
1 parent 2b8cab3 commit 0466609
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions corelib/opal/basic_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __send__(symbol, *args, &block)
def instance_eval(&block)
%x{
if (block === nil) {
no_block_given();
throw new Error("no block given");
}
var block_self = block._s, result;
Expand All @@ -42,7 +42,7 @@ def instance_eval(&block)
def instance_exec(*args, &block)
%x{
if (block === nil) {
no_block_given();
throw new Error("no block given");
}
var block_self = block._s, result;
Expand Down
2 changes: 1 addition & 1 deletion corelib/opal/kernel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def class
def define_singleton_method(name, &body)
%x{
if (body === nil) {
no_block_given();
throw new Error("no block given");
}
var jsid = '$' + name;
Expand Down
4 changes: 2 additions & 2 deletions corelib/opal/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def define_method(name, method = undefined, &block)
}
if (block === nil) {
no_block_given();
throw new Error("no block given");
}
var jsid = '$' + name;
Expand Down Expand Up @@ -322,7 +322,7 @@ def included(mod)
def module_eval(&block)
%x{
if (block === nil) {
no_block_given();
throw new Error("no block given");
}
var block_self = block._s, result;
Expand Down
2 changes: 1 addition & 1 deletion corelib/opal/proc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Proc
`def.is_lambda = true`

def self.new(&block)
`if (block === nil) no_block_given();`
`if (block === nil) { throw new Error("no block given"); }`
`block.is_lambda = false`
block
end
Expand Down
5 changes: 0 additions & 5 deletions corelib/opal/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@
return klass;
};

// Utility function to raise a "no block given" error
var no_block_given = function() {
throw new Error('no block given');
};

// Boot a base class (makes instances).
var boot_defclass = function(id, constructor, superklass) {
if (superklass) {
Expand Down

0 comments on commit 0466609

Please sign in to comment.