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: e6c944e19c14
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7473df77e16a
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Dec 4, 2013

  1. Copy the full SHA
    55f625a View commit details
  2. Copy the full SHA
    a902b16 View commit details
  3. Merge pull request #451 from marcandre/compile_with_options

    Compile with options
    adambeynon committed Dec 4, 2013
    Copy the full SHA
    7473df7 View commit details
Showing with 23 additions and 11 deletions.
  1. +16 −7 opal/corelib/runtime.js
  2. +7 −4 stdlib/opal-parser.rb
23 changes: 16 additions & 7 deletions opal/corelib/runtime.js
Original file line number Diff line number Diff line change
@@ -751,17 +751,26 @@
hash.map = assocs;
hash.keys = keys;

if (arguments.length == 1 && arguments[0]._isArray) {
var args = arguments[0];
if (arguments.length == 1) {
if (arguments[0]._isArray) {
var args = arguments[0];

for (var i = 0, length = args.length; i < length; i++) {
var key = args[i][0], obj = args[i][1];
for (var i = 0, length = args.length; i < length; i++) {
var key = args[i][0], obj = args[i][1];

if (assocs[key] == null) {
if (assocs[key] == null) {
keys.push(key);
}

assocs[key] = obj;
}
}
else {
var obj = arguments[0];
for (var key in obj) {
assocs[key] = obj[key];
keys.push(key);
}

assocs[key] = obj;
}
}
else {
11 changes: 7 additions & 4 deletions stdlib/opal-parser.rb
Original file line number Diff line number Diff line change
@@ -11,12 +11,15 @@ def eval(str)
end

%x{
Opal.compile = function(str) {
return Opal.Opal.$compile(str);
Opal.compile = function(str, options) {
if (options) {
options = Opal.hash(options);
}
return Opal.Opal.$compile(str, options);
};
Opal.eval = function(str) {
return eval(Opal.compile(str));
Opal.eval = function(str, options) {
return eval(Opal.compile(str, options));
};
function run_ruby_scripts() {