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

Commits on May 19, 2015

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    ondrejmirtes Ondřej Mirtes
    Copy the full SHA
    e416e4b View commit details
  2. Merge pull request #878 from vais/lint

    Fix all accidental global variables except the compiler-generated ones
    elia committed May 19, 2015

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    ondrejmirtes Ondřej Mirtes
    Copy the full SHA
    ee35c34 View commit details
Showing with 17 additions and 11 deletions.
  1. +7 −1 .jshintrc
  2. +1 −1 opal/corelib/enumerable.rb
  3. +6 −6 opal/corelib/hash.rb
  4. +1 −1 opal/corelib/module.rb
  5. +1 −1 opal/corelib/runtime.js
  6. +1 −1 stdlib/native.rb
8 changes: 7 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -12,9 +12,15 @@
"unused" : true, // Warn when you define and never use your variables

"globals": {
"Opal": true
"Opal": true,
"OpalNode": true,
"callPhantom": true,
"JSON": true
},

"browser": true,
"node": true,

// Currently the following checks are failing:

"-W003": false, // 'variable' was used before it was defined
2 changes: 1 addition & 1 deletion opal/corelib/enumerable.rb
Original file line number Diff line number Diff line change
@@ -943,7 +943,7 @@ def partition(&block)
return enum_for :partition unless block_given?

%x{
var truthy = [], falsy = [];
var truthy = [], falsy = [], result;
self.$each.$$p = function() {
var param = #{Opal.destructure(`arguments`)},
12 changes: 6 additions & 6 deletions opal/corelib/hash.rb
Original file line number Diff line number Diff line change
@@ -363,7 +363,7 @@ def each_value(&block)
%x{
var _map = self.map,
smap = self.smap,
keys = self.keys;
keys = self.keys, key, map, khash;
for (var i = 0, length = keys.length; i < length; i++) {
key = keys[i];
@@ -613,7 +613,7 @@ def inspect
var key, value,
inspect = [],
keys = self.keys
keys = self.keys,
id = self.$object_id(),
counter = 0;
@@ -820,7 +820,7 @@ def rassoc(object)
var keys = self.keys,
_map = self.map,
smap = self.smap,
key, khash, value;
key, khash, value, map;
for (var i = 0, length = keys.length; i < length; i++) {
key = keys[i]
@@ -967,7 +967,7 @@ def select!(&block)
smap = self.smap,
keys = self.keys,
result = nil,
key, khash, value, object;
key, khash, value, object, map;
for (var i = 0, length = keys.length; i < length; i++) {
key = keys[i];
@@ -1039,7 +1039,7 @@ def to_a
_map = self.map,
smap = self.smap,
result = [],
map, key;
map, key, khash;
for (var i = 0, length = keys.length; i < length; i++) {
key = keys[i];
@@ -1096,7 +1096,7 @@ def values
smap = self.smap,
keys = self.keys,
result = [],
map, khash;
map, khash, key;
for (var i = 0, length = keys.length; i < length; i++) {
key = keys[i];
2 changes: 1 addition & 1 deletion opal/corelib/module.rb
Original file line number Diff line number Diff line change
@@ -198,7 +198,7 @@ def const_defined?(name, inherit = true)
raise NameError, "wrong constant name #{name}" unless name =~ /^[A-Z]\w*$/

%x{
scopes = [self.$$scope];
var scopes = [self.$$scope];
if (inherit || self === Opal.Object) {
var parent = self.$$super;
2 changes: 1 addition & 1 deletion opal/corelib/runtime.js
Original file line number Diff line number Diff line change
@@ -1155,7 +1155,7 @@
keys = [],
_map = {},
smap = {},
key, obj, length, khash;
key, obj, length, khash, map;

hash.map = _map;
hash.smap = smap;
2 changes: 1 addition & 1 deletion stdlib/native.rb
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@ def to_n
keys = self.keys,
_map = self.map,
smap = self.smap,
map, khash, value;
map, khash, value, key;
for (var i = 0, length = keys.length; i < length; i++) {
key = keys[i];