Skip to content

Commit 26f6149

Browse files
committed
Internals, $$ Ed.
__meta__ > $$meta __inc__ > $$inc __dep__ > $$dep __mod__ > $$mod __autoload > $$autoload __parent > $$parent _isClass > $$is_class _isSingleton > $$is_singleton _isArray > $$is_array _isRange > $$is_range _isRegexp > $$is_regexp _isBoolean > $$is_boolean _isString > $$is_string _isProc > $$is_proc _base_module > $$base_module _orig_scope > $$orig_scope _full_name > $$full_name _donated > $$donated _methods > $$methods _proto > $$proto _scope > $$scope _klass > $$class _super > $$super _name > $$name _jsid > $$jsid _def > $$def _id > $$id _p > $$p _s > $$s
1 parent c3157a7 commit 26f6149

36 files changed

+384
-384
lines changed

lib/opal/nodes/call.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def default_compile
6666

6767
if blktmp
6868
unshift "(#{blktmp} = "
69-
push ", #{blktmp}._p = ", block, ", #{blktmp})"
69+
push ", #{blktmp}.$$p = ", block, ", #{blktmp})"
7070
end
7171

7272
if splat

lib/opal/nodes/class.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def compile
1717

1818
in_scope do
1919
scope.name = name
20-
add_temp "#{scope.proto} = self._proto"
21-
add_temp "$scope = self._scope"
20+
add_temp "#{scope.proto} = self.$$proto"
21+
add_temp "$scope = self.$$scope"
2222

2323
body_code = self.body_code
2424
empty_line

lib/opal/nodes/constants.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ConstGetNode < Base
4949
def compile
5050
push "(("
5151
push expr(base)
52-
push ")._scope.get('#{name}'))"
52+
push ").$$scope.get('#{name}'))"
5353
end
5454
end
5555

lib/opal/nodes/def.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ def compile
7070
scope_name = scope.identity
7171

7272
if scope.uses_block?
73-
add_temp "$iter = #{scope_name}._p"
73+
add_temp "$iter = #{scope_name}.$$p"
7474
add_temp "#{yielder} = $iter || nil"
7575

76-
line "#{scope_name}._p = null;"
76+
line "#{scope_name}.$$p = null;"
7777
end
7878

7979
unshift "\n#{current_indent}", scope.to_vars
@@ -107,9 +107,9 @@ def compile
107107
elsif scope.iter?
108108
wrap "$opal.defn(self, '$#{mid}', ", ')'
109109
elsif scope.type == :sclass
110-
unshift "self._proto#{jsid} = "
110+
unshift "self.$$proto#{jsid} = "
111111
elsif scope.top?
112-
unshift "$opal.Object._proto#{jsid} = "
112+
unshift "$opal.Object.$$proto#{jsid} = "
113113
else
114114
unshift "def#{jsid} = "
115115
end

lib/opal/nodes/defined.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ def compile_colon2
7575
# does not raise errors is needed
7676
push "(function(){ try { return (("
7777
push expr(value)
78-
push ") != null ? 'constant' : nil); } catch (err) { if (err._klass"
78+
push ") != null ? 'constant' : nil); } catch (err) { if (err.$$class"
7979
push " === Opal.NameError) { return nil; } else { throw(err); }}; })()"
8080
end
8181

8282
def compile_colon3
83-
push "($opal.Object._scope.#{value[1]} == null ? nil : 'constant')"
83+
push "($opal.Object.$$scope.#{value[1]} == null ? nil : 'constant')"
8484
end
8585

8686
def compile_cvar

lib/opal/nodes/definitions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def compile
4242
scope.methods << "$#{new_name[1]}"
4343
push "$opal.defn(self, '$#{new_name[1]}', #{scope.proto}#{old_mid})"
4444
else
45-
push "self._proto#{new_mid} = self._proto#{old_mid}"
45+
push "self.$$proto#{new_mid} = self.$$proto#{old_mid}"
4646
end
4747
end
4848
end

lib/opal/nodes/helpers.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def js_truthy(sexp)
7676
end
7777

7878
with_temp do |tmp|
79-
[fragment("((#{tmp} = "), expr(sexp), fragment(") !== nil && (!#{tmp}._isBoolean || #{tmp} == true))")]
79+
[fragment("((#{tmp} = "), expr(sexp), fragment(") !== nil && (!#{tmp}.$$is_boolean || #{tmp} == true))")]
8080
end
8181
end
8282

@@ -90,7 +90,7 @@ def js_falsy(sexp)
9090
end
9191

9292
with_temp do |tmp|
93-
[fragment("((#{tmp} = "), expr(sexp), fragment(") === nil || (#{tmp}._isBoolean && #{tmp} == false))")]
93+
[fragment("((#{tmp} = "), expr(sexp), fragment(") === nil || (#{tmp}.$$is_boolean && #{tmp} == false))")]
9494
end
9595
end
9696

lib/opal/nodes/iter.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def compile
2525

2626
in_scope do
2727
identity = scope.identify!
28-
add_temp "self = #{identity}._s || this"
28+
add_temp "self = #{identity}.$$s || this"
2929

3030
compile_args(args[1..-1], opt_args, params)
3131

@@ -39,7 +39,7 @@ def compile
3939
scope.add_temp block_arg
4040
scope_name = scope.identify!
4141

42-
line "#{block_arg} = #{scope_name}._p || nil, #{scope_name}._p = null;"
42+
line "#{block_arg} = #{scope_name}.$$p || nil, #{scope_name}.$$p = null;"
4343
end
4444

4545
body_code = stmt(body)
@@ -51,7 +51,7 @@ def compile
5151
unshift to_vars
5252

5353
unshift "(#{identity} = function(#{params.join ', '}){"
54-
push "}, #{identity}._s = self, #{identity})"
54+
push "}, #{identity}.$$s = self, #{identity})"
5555
end
5656

5757
def compile_args(args, opt_args, params)

lib/opal/nodes/masgn.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def compile
1818
push "#{tmp} = $opal.to_ary(", expr(rhs[1]), ")"
1919
elsif rhs.type == :splat
2020
push "(#{tmp} = ", expr(rhs[1]), ")['$to_a'] ? (#{tmp} = #{tmp}['$to_a']())"
21-
push " : (#{tmp})._isArray ? #{tmp} : (#{tmp} = [#{tmp}])"
21+
push " : (#{tmp}).$$is_array ? #{tmp} : (#{tmp} = [#{tmp}])"
2222
else
2323
raise "unsupported mlhs type"
2424
end

lib/opal/nodes/module.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def compile
1616

1717
in_scope do
1818
scope.name = name
19-
add_temp "#{scope.proto} = self._proto"
20-
add_temp '$scope = self._scope'
19+
add_temp "#{scope.proto} = self.$$proto"
20+
add_temp '$scope = self.$$scope'
2121

2222
body_code = stmt(body || s(:nil))
2323
empty_line

0 commit comments

Comments
 (0)