Sha256: 2123d6d40918deb461f091938a84f51cade527be6a60fb1fb8188db45c71c0f6
Contents?: true
Size: 656 Bytes
Versions: 24
Compression:
Stored size: 656 Bytes
Contents
# frozen_string_literal: true require 'opal/nodes/base' module Opal module Nodes module Args # A utility node responsible for compiling # a runtime validation for kwargs. # # This node is used for both inline and post-kwargs # class EnsureKwargsAreKwargs < Base handle :ensure_kwargs_are_kwargs def compile helper :hash2 line 'if ($kwargs == null) {' line ' $kwargs = $hash2([], {});' line '} else if (!$kwargs.$$is_hash) {' line " throw Opal.ArgumentError.$new('expected kwargs');" line '}' end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems