Sha256: 0ea1443d8433a8d96b3d24e9ca318e88555986cf8fe2ee263489cc906c7f0a6f
Contents?: true
Size: 652 Bytes
Versions: 22
Compression:
Stored size: 652 Bytes
Contents
# frozen_string_literal: true require 'opal/nodes/scope' module Opal module Nodes class SingletonClassNode < ScopeNode handle :sclass children :object, :body def compile push '(function(self, $parent_nesting) {' in_scope do body_stmt = stmt(compiler.returns(body)) add_temp '$nesting = [self].concat($parent_nesting)' if @define_nesting add_temp '$$ = Opal.$r($nesting)' if @define_relative_access line scope.to_vars line body_stmt end line '})(Opal.get_singleton_class(', recv(object), "), #{scope.nesting})" end end end end
Version data entries
22 entries across 22 versions & 1 rubygems