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

Commits on Sep 29, 2014

  1. Rename setup_module{,_or_class}_object

    Make clear that’s for both modules and classes.
    elia committed Sep 29, 2014

    Verified

    This commit was signed with the committer’s verified signature.
    markuskowa Markus Kowalewski
    Copy the full SHA
    608df0d View commit details
  2. Style fixes for runtime.js

    elia committed Sep 29, 2014
    Copy the full SHA
    8cdd3ad View commit details
Showing with 20 additions and 20 deletions.
  1. +20 −20 opal/corelib/runtime.js
40 changes: 20 additions & 20 deletions opal/corelib/runtime.js
Original file line number Diff line number Diff line change
@@ -183,7 +183,7 @@

var klass = new OpalClass();

setup_module_object(klass, OpalClass, superklass, alloc.prototype);
setup_module_or_class_object(klass, OpalClass, superklass, alloc.prototype);

// @property $$alloc This is the constructor of instances of the current
// class. Its prototype will be used for method lookup
@@ -212,7 +212,7 @@
* @param prototype The prototype on which the class/module methods will
* be stored.
*/
function setup_module_object(module, constructor, superklass, prototype) {
function setup_module_or_class_object(module, constructor, superklass, prototype) {
// @property $$id Each class is assigned a unique `id` that helps
// comparation and implementation of `#object_id`
module.$$id = unique_id++;
@@ -293,7 +293,7 @@
var module = new module_constructor();
var module_prototype = {};

setup_module_object(module, module_constructor, ModuleClass, module_prototype);
setup_module_or_class_object(module, module_constructor, ModuleClass, module_prototype);
module.$$is_mod = true;
module.$$dep = [];

@@ -439,7 +439,7 @@
// the singleton_class acts as the class object constructor
var klass = new singleton_class();

setup_module_object(klass, singleton_class, superclass, alloc.prototype);
setup_module_or_class_object(klass, singleton_class, superclass, alloc.prototype);

klass.$$alloc = alloc;
klass.$$name = id;
@@ -695,7 +695,7 @@
}
};

var find_obj_super_dispatcher = function(obj, jsid, current_func) {
function find_obj_super_dispatcher(obj, jsid, current_func) {
var klass = obj.$$meta || obj.$$class;
jsid = '$' + jsid;

@@ -831,20 +831,20 @@
};

/*
Call a ruby method on a ruby object with some arguments:
var my_array = [1, 2, 3, 4]
Opal.send(my_array, 'length') # => 4
Opal.send(my_array, 'reverse!') # => [4, 3, 2, 1]
A missing method will be forwarded to the object via
method_missing.
The result of either call with be returned.
@param [Object] recv the ruby object
@param [String] mid ruby method to call
*/
* Call a ruby method on a ruby object with some arguments:
*
* var my_array = [1, 2, 3, 4]
* Opal.send(my_array, 'length') # => 4
* Opal.send(my_array, 'reverse!') # => [4, 3, 2, 1]
*
* A missing method will be forwarded to the object via
* method_missing.
*
* The result of either call with be returned.
*
* @param [Object] recv the ruby object
* @param [String] mid ruby method to call
*/
Opal.send = function(recv, mid) {
var args = $slice.call(arguments, 2),
func = recv['$' + mid];
@@ -868,7 +868,7 @@
return recv.$method_missing.apply(recv, [mid].concat(args));
};

/**
/*
* Donate methods for a class/module
*/
Opal.donate = function(klass, defined, indirect) {