@blazetrails/ruby-compat 0.0.0-stage → 0.1.0-alpha0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE +6 -0
- package/README.md +440 -2
- package/dist/argument-error.d.ts +15 -0
- package/dist/argument-error.js +15 -0
- package/dist/argument-error.js.map +1 -0
- package/dist/array.d.ts +415 -0
- package/dist/array.js +1330 -0
- package/dist/array.js.map +1 -0
- package/dist/async-context-adapter.d.ts +19 -0
- package/dist/async-context-adapter.js +139 -0
- package/dist/async-context-adapter.js.map +1 -0
- package/dist/backtrace-location.d.ts +78 -0
- package/dist/backtrace-location.js +158 -0
- package/dist/backtrace-location.js.map +1 -0
- package/dist/base64.d.ts +73 -0
- package/dist/base64.js +164 -0
- package/dist/base64.js.map +1 -0
- package/dist/benchmark.d.ts +19 -0
- package/dist/benchmark.js +16 -0
- package/dist/benchmark.js.map +1 -0
- package/dist/big-decimal.d.ts +111 -0
- package/dist/big-decimal.js +584 -0
- package/dist/big-decimal.js.map +1 -0
- package/dist/bundler.d.ts +44 -0
- package/dist/bundler.js +97 -0
- package/dist/bundler.js.map +1 -0
- package/dist/cgi.d.ts +89 -0
- package/dist/cgi.js +168 -0
- package/dist/cgi.js.map +1 -0
- package/dist/child-process-adapter.d.ts +110 -0
- package/dist/child-process-adapter.js +272 -0
- package/dist/child-process-adapter.js.map +1 -0
- package/dist/class-module.d.ts +10 -0
- package/dist/class-module.js +10 -0
- package/dist/class-module.js.map +1 -0
- package/dist/classpath.d.ts +93 -0
- package/dist/classpath.js +210 -0
- package/dist/classpath.js.map +1 -0
- package/dist/closed-queue-error.d.ts +10 -0
- package/dist/closed-queue-error.js +10 -0
- package/dist/closed-queue-error.js.map +1 -0
- package/dist/comparable.d.ts +127 -0
- package/dist/comparable.js +376 -0
- package/dist/comparable.js.map +1 -0
- package/dist/complex.d.ts +49 -0
- package/dist/complex.js +164 -0
- package/dist/complex.js.map +1 -0
- package/dist/concurrent/atomic-boolean.d.ts +24 -0
- package/dist/concurrent/atomic-boolean.js +43 -0
- package/dist/concurrent/atomic-boolean.js.map +1 -0
- package/dist/concurrent/atomic-fixnum.d.ts +21 -0
- package/dist/concurrent/atomic-fixnum.js +35 -0
- package/dist/concurrent/atomic-fixnum.js.map +1 -0
- package/dist/concurrent/count-down-latch.d.ts +20 -0
- package/dist/concurrent/count-down-latch.js +50 -0
- package/dist/concurrent/count-down-latch.js.map +1 -0
- package/dist/concurrent/cyclic-barrier.d.ts +18 -0
- package/dist/concurrent/cyclic-barrier.js +50 -0
- package/dist/concurrent/cyclic-barrier.js.map +1 -0
- package/dist/concurrent/event.d.ts +19 -0
- package/dist/concurrent/event.js +31 -0
- package/dist/concurrent/event.js.map +1 -0
- package/dist/concurrent/map.d.ts +149 -0
- package/dist/concurrent/map.js +202 -0
- package/dist/concurrent/map.js.map +1 -0
- package/dist/concurrent/read-write-lock.d.ts +25 -0
- package/dist/concurrent/read-write-lock.js +70 -0
- package/dist/concurrent/read-write-lock.js.map +1 -0
- package/dist/concurrent/semaphore.d.ts +24 -0
- package/dist/concurrent/semaphore.js +74 -0
- package/dist/concurrent/semaphore.js.map +1 -0
- package/dist/concurrent/timer-task.d.ts +52 -0
- package/dist/concurrent/timer-task.js +112 -0
- package/dist/concurrent/timer-task.js.map +1 -0
- package/dist/constants.generated.d.ts +2 -0
- package/dist/constants.generated.js +64 -0
- package/dist/constants.generated.js.map +1 -0
- package/dist/converter-not-found-error.d.ts +14 -0
- package/dist/converter-not-found-error.js +14 -0
- package/dist/converter-not-found-error.js.map +1 -0
- package/dist/crypto-adapter.d.ts +64 -0
- package/dist/crypto-adapter.js +365 -0
- package/dist/crypto-adapter.js.map +1 -0
- package/dist/delegate.d.ts +156 -0
- package/dist/delegate.js +306 -0
- package/dist/delegate.js.map +1 -0
- package/dist/digest.d.ts +99 -0
- package/dist/digest.js +131 -0
- package/dist/digest.js.map +1 -0
- package/dist/dir.d.ts +225 -0
- package/dist/dir.js +608 -0
- package/dist/dir.js.map +1 -0
- package/dist/encoding-error.d.ts +14 -0
- package/dist/encoding-error.js +17 -0
- package/dist/encoding-error.js.map +1 -0
- package/dist/encoding.d.ts +121 -0
- package/dist/encoding.js +306 -0
- package/dist/encoding.js.map +1 -0
- package/dist/ensure.d.ts +15 -0
- package/dist/ensure.js +35 -0
- package/dist/ensure.js.map +1 -0
- package/dist/enumerable.d.ts +375 -0
- package/dist/enumerable.js +1102 -0
- package/dist/enumerable.js.map +1 -0
- package/dist/enumerator.d.ts +324 -0
- package/dist/enumerator.js +625 -0
- package/dist/enumerator.js.map +1 -0
- package/dist/eof-error.d.ts +14 -0
- package/dist/eof-error.js +14 -0
- package/dist/eof-error.js.map +1 -0
- package/dist/errno.d.ts +447 -0
- package/dist/errno.js +616 -0
- package/dist/errno.js.map +1 -0
- package/dist/exc-detailed-message.d.ts +15 -0
- package/dist/exc-detailed-message.js +106 -0
- package/dist/exc-detailed-message.js.map +1 -0
- package/dist/exc-to-s.d.ts +10 -0
- package/dist/exc-to-s.js +21 -0
- package/dist/exc-to-s.js.map +1 -0
- package/dist/exception.d.ts +44 -0
- package/dist/exception.js +115 -0
- package/dist/exception.js.map +1 -0
- package/dist/fiber-error.d.ts +12 -0
- package/dist/fiber-error.js +12 -0
- package/dist/fiber-error.js.map +1 -0
- package/dist/fiber.d.ts +51 -0
- package/dist/fiber.js +178 -0
- package/dist/fiber.js.map +1 -0
- package/dist/file-utils.d.ts +480 -0
- package/dist/file-utils.js +1824 -0
- package/dist/file-utils.js.map +1 -0
- package/dist/file.d.ts +643 -0
- package/dist/file.js +1334 -0
- package/dist/file.js.map +1 -0
- package/dist/float-domain-error.d.ts +17 -0
- package/dist/float-domain-error.js +17 -0
- package/dist/float-domain-error.js.map +1 -0
- package/dist/fork-children.d.ts +23 -0
- package/dist/fork-children.js +32 -0
- package/dist/fork-children.js.map +1 -0
- package/dist/frozen-error.d.ts +33 -0
- package/dist/frozen-error.js +41 -0
- package/dist/frozen-error.js.map +1 -0
- package/dist/fs-adapter.d.ts +158 -0
- package/dist/fs-adapter.js +253 -0
- package/dist/fs-adapter.js.map +1 -0
- package/dist/gem/deprecate.d.ts +10 -0
- package/dist/gem/deprecate.js +8 -0
- package/dist/gem/deprecate.js.map +1 -0
- package/dist/gem/requirement.d.ts +55 -0
- package/dist/gem/requirement.js +91 -0
- package/dist/gem/requirement.js.map +1 -0
- package/dist/gem/version.d.ts +50 -0
- package/dist/gem/version.js +148 -0
- package/dist/gem/version.js.map +1 -0
- package/dist/gem.d.ts +59 -0
- package/dist/gem.js +82 -0
- package/dist/gem.js.map +1 -0
- package/dist/hash.d.ts +967 -0
- package/dist/hash.js +1572 -0
- package/dist/hash.js.map +1 -0
- package/dist/http-adapter.d.ts +124 -0
- package/dist/http-adapter.js +220 -0
- package/dist/http-adapter.js.map +1 -0
- package/dist/immediate-executor.d.ts +20 -0
- package/dist/immediate-executor.js +39 -0
- package/dist/immediate-executor.js.map +1 -0
- package/dist/include.d.ts +778 -0
- package/dist/include.js +2208 -0
- package/dist/include.js.map +1 -0
- package/dist/index-error.d.ts +13 -0
- package/dist/index-error.js +13 -0
- package/dist/index-error.js.map +1 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.js +166 -0
- package/dist/index.js.map +1 -0
- package/dist/invalid-byte-sequence-error.d.ts +62 -0
- package/dist/invalid-byte-sequence-error.js +75 -0
- package/dist/invalid-byte-sequence-error.js.map +1 -0
- package/dist/io-error.d.ts +14 -0
- package/dist/io-error.js +17 -0
- package/dist/io-error.js.map +1 -0
- package/dist/io.d.ts +867 -0
- package/dist/io.js +1960 -0
- package/dist/io.js.map +1 -0
- package/dist/ipaddr.d.ts +79 -0
- package/dist/ipaddr.js +405 -0
- package/dist/ipaddr.js.map +1 -0
- package/dist/json.d.ts +70 -0
- package/dist/json.js +181 -0
- package/dist/json.js.map +1 -0
- package/dist/kernel-catch.d.ts +59 -0
- package/dist/kernel-catch.js +184 -0
- package/dist/kernel-catch.js.map +1 -0
- package/dist/kernel-float.d.ts +19 -0
- package/dist/kernel-float.js +54 -0
- package/dist/kernel-float.js.map +1 -0
- package/dist/kernel-fork.d.ts +30 -0
- package/dist/kernel-fork.js +72 -0
- package/dist/kernel-fork.js.map +1 -0
- package/dist/kernel-format.d.ts +27 -0
- package/dist/kernel-format.js +901 -0
- package/dist/kernel-format.js.map +1 -0
- package/dist/kernel-hash.d.ts +7 -0
- package/dist/kernel-hash.js +33 -0
- package/dist/kernel-hash.js.map +1 -0
- package/dist/kernel-integer.d.ts +49 -0
- package/dist/kernel-integer.js +170 -0
- package/dist/kernel-integer.js.map +1 -0
- package/dist/kernel-rand.d.ts +16 -0
- package/dist/kernel-rand.js +237 -0
- package/dist/kernel-rand.js.map +1 -0
- package/dist/kernel-system.d.ts +39 -0
- package/dist/kernel-system.js +103 -0
- package/dist/kernel-system.js.map +1 -0
- package/dist/kernel-warn.d.ts +35 -0
- package/dist/kernel-warn.js +73 -0
- package/dist/kernel-warn.js.map +1 -0
- package/dist/key-error.d.ts +44 -0
- package/dist/key-error.js +59 -0
- package/dist/key-error.js.map +1 -0
- package/dist/keyword-splat.d.ts +41 -0
- package/dist/keyword-splat.js +65 -0
- package/dist/keyword-splat.js.map +1 -0
- package/dist/load-error.d.ts +19 -0
- package/dist/load-error.js +19 -0
- package/dist/load-error.js.map +1 -0
- package/dist/load.d.ts +128 -0
- package/dist/load.js +278 -0
- package/dist/load.js.map +1 -0
- package/dist/loaded-features.d.ts +13 -0
- package/dist/loaded-features.js +15 -0
- package/dist/loaded-features.js.map +1 -0
- package/dist/local-jump-error.d.ts +12 -0
- package/dist/local-jump-error.js +12 -0
- package/dist/local-jump-error.js.map +1 -0
- package/dist/logger/formatter.d.ts +21 -0
- package/dist/logger/formatter.js +43 -0
- package/dist/logger/formatter.js.map +1 -0
- package/dist/logger/log-device.d.ts +52 -0
- package/dist/logger/log-device.js +104 -0
- package/dist/logger/log-device.js.map +1 -0
- package/dist/logger/severity.d.ts +23 -0
- package/dist/logger/severity.js +42 -0
- package/dist/logger/severity.js.map +1 -0
- package/dist/logger.d.ts +127 -0
- package/dist/logger.js +218 -0
- package/dist/logger.js.map +1 -0
- package/dist/marshal.d.ts +83 -0
- package/dist/marshal.js +1487 -0
- package/dist/marshal.js.map +1 -0
- package/dist/match-data.d.ts +161 -0
- package/dist/match-data.js +284 -0
- package/dist/match-data.js.map +1 -0
- package/dist/method-cache.d.ts +81 -0
- package/dist/method-cache.js +109 -0
- package/dist/method-cache.js.map +1 -0
- package/dist/method-missing-proxy.d.ts +53 -0
- package/dist/method-missing-proxy.js +154 -0
- package/dist/method-missing-proxy.js.map +1 -0
- package/dist/method.d.ts +132 -0
- package/dist/method.js +320 -0
- package/dist/method.js.map +1 -0
- package/dist/monitor.d.ts +114 -0
- package/dist/monitor.js +270 -0
- package/dist/monitor.js.map +1 -0
- package/dist/mutex.d.ts +51 -0
- package/dist/mutex.js +150 -0
- package/dist/mutex.js.map +1 -0
- package/dist/name-error.d.ts +45 -0
- package/dist/name-error.js +54 -0
- package/dist/name-error.js.map +1 -0
- package/dist/net/http/exceptions.d.ts +31 -0
- package/dist/net/http/exceptions.js +46 -0
- package/dist/net/http/exceptions.js.map +1 -0
- package/dist/net/http/request.d.ts +137 -0
- package/dist/net/http/request.js +559 -0
- package/dist/net/http/request.js.map +1 -0
- package/dist/net/http/requests.d.ts +197 -0
- package/dist/net/http/requests.js +197 -0
- package/dist/net/http/requests.js.map +1 -0
- package/dist/net/http/response.d.ts +141 -0
- package/dist/net/http/response.js +416 -0
- package/dist/net/http/response.js.map +1 -0
- package/dist/net/http/responses.d.ts +345 -0
- package/dist/net/http/responses.js +486 -0
- package/dist/net/http/responses.js.map +1 -0
- package/dist/net/http.d.ts +278 -0
- package/dist/net/http.js +760 -0
- package/dist/net/http.js.map +1 -0
- package/dist/net/protocol.d.ts +227 -0
- package/dist/net/protocol.js +392 -0
- package/dist/net/protocol.js.map +1 -0
- package/dist/nil-class.d.ts +10 -0
- package/dist/nil-class.js +27 -0
- package/dist/nil-class.js.map +1 -0
- package/dist/no-method-error.d.ts +38 -0
- package/dist/no-method-error.js +45 -0
- package/dist/no-method-error.js.map +1 -0
- package/dist/not-implemented-error.d.ts +13 -0
- package/dist/not-implemented-error.js +13 -0
- package/dist/not-implemented-error.js.map +1 -0
- package/dist/numeric-class.d.ts +29 -0
- package/dist/numeric-class.js +41 -0
- package/dist/numeric-class.js.map +1 -0
- package/dist/numeric.d.ts +226 -0
- package/dist/numeric.js +848 -0
- package/dist/numeric.js.map +1 -0
- package/dist/object-space.d.ts +34 -0
- package/dist/object-space.js +152 -0
- package/dist/object-space.js.map +1 -0
- package/dist/object.d.ts +833 -0
- package/dist/object.js +2131 -0
- package/dist/object.js.map +1 -0
- package/dist/open-uri.d.ts +180 -0
- package/dist/open-uri.js +402 -0
- package/dist/open-uri.js.map +1 -0
- package/dist/open3.d.ts +69 -0
- package/dist/open3.js +134 -0
- package/dist/open3.js.map +1 -0
- package/dist/openssl.d.ts +479 -0
- package/dist/openssl.js +1052 -0
- package/dist/openssl.js.map +1 -0
- package/dist/optparse.d.ts +130 -0
- package/dist/optparse.js +457 -0
- package/dist/optparse.js.map +1 -0
- package/dist/os-adapter.d.ts +20 -0
- package/dist/os-adapter.js +95 -0
- package/dist/os-adapter.js.map +1 -0
- package/dist/pathname.d.ts +73 -0
- package/dist/pathname.js +412 -0
- package/dist/pathname.js.map +1 -0
- package/dist/pp.d.ts +60 -0
- package/dist/pp.js +195 -0
- package/dist/pp.js.map +1 -0
- package/dist/pretty-print.d.ts +89 -0
- package/dist/pretty-print.js +232 -0
- package/dist/pretty-print.js.map +1 -0
- package/dist/process-adapter.d.ts +229 -0
- package/dist/process-adapter.js +889 -0
- package/dist/process-adapter.js.map +1 -0
- package/dist/process.d.ts +202 -0
- package/dist/process.js +433 -0
- package/dist/process.js.map +1 -0
- package/dist/psych/class-loader.d.ts +92 -0
- package/dist/psych/class-loader.js +139 -0
- package/dist/psych/class-loader.js.map +1 -0
- package/dist/psych/coder.d.ts +144 -0
- package/dist/psych/coder.js +176 -0
- package/dist/psych/coder.js.map +1 -0
- package/dist/psych/core-ext.d.ts +8 -0
- package/dist/psych/core-ext.js +10 -0
- package/dist/psych/core-ext.js.map +1 -0
- package/dist/psych/emitter.d.ts +116 -0
- package/dist/psych/emitter.js +1130 -0
- package/dist/psych/emitter.js.map +1 -0
- package/dist/psych/exception.d.ts +43 -0
- package/dist/psych/exception.js +54 -0
- package/dist/psych/exception.js.map +1 -0
- package/dist/psych/handler.d.ts +59 -0
- package/dist/psych/handler.js +95 -0
- package/dist/psych/handler.js.map +1 -0
- package/dist/psych/handlers/document-stream.d.ts +17 -0
- package/dist/psych/handlers/document-stream.js +26 -0
- package/dist/psych/handlers/document-stream.js.map +1 -0
- package/dist/psych/nodes/alias.d.ts +15 -0
- package/dist/psych/nodes/alias.js +22 -0
- package/dist/psych/nodes/alias.js.map +1 -0
- package/dist/psych/nodes/document.d.ts +23 -0
- package/dist/psych/nodes/document.js +35 -0
- package/dist/psych/nodes/document.js.map +1 -0
- package/dist/psych/nodes/mapping.d.ts +25 -0
- package/dist/psych/nodes/mapping.js +35 -0
- package/dist/psych/nodes/mapping.js.map +1 -0
- package/dist/psych/nodes/node.d.ts +59 -0
- package/dist/psych/nodes/node.js +79 -0
- package/dist/psych/nodes/node.js.map +1 -0
- package/dist/psych/nodes/scalar.d.ts +35 -0
- package/dist/psych/nodes/scalar.js +47 -0
- package/dist/psych/nodes/scalar.js.map +1 -0
- package/dist/psych/nodes/sequence.d.ts +25 -0
- package/dist/psych/nodes/sequence.js +35 -0
- package/dist/psych/nodes/sequence.js.map +1 -0
- package/dist/psych/nodes/stream.d.ts +23 -0
- package/dist/psych/nodes/stream.js +31 -0
- package/dist/psych/nodes/stream.js.map +1 -0
- package/dist/psych/omap.d.ts +9 -0
- package/dist/psych/omap.js +9 -0
- package/dist/psych/omap.js.map +1 -0
- package/dist/psych/parser.d.ts +41 -0
- package/dist/psych/parser.js +139 -0
- package/dist/psych/parser.js.map +1 -0
- package/dist/psych/scalar-scanner.d.ts +31 -0
- package/dist/psych/scalar-scanner.js +169 -0
- package/dist/psych/scalar-scanner.js.map +1 -0
- package/dist/psych/syntax-error.d.ts +23 -0
- package/dist/psych/syntax-error.js +35 -0
- package/dist/psych/syntax-error.js.map +1 -0
- package/dist/psych/tree-builder.d.ts +51 -0
- package/dist/psych/tree-builder.js +118 -0
- package/dist/psych/tree-builder.js.map +1 -0
- package/dist/psych/visitors/depth-first.d.ts +27 -0
- package/dist/psych/visitors/depth-first.js +37 -0
- package/dist/psych/visitors/depth-first.js.map +1 -0
- package/dist/psych/visitors/emitter.d.ts +32 -0
- package/dist/psych/visitors/emitter.js +63 -0
- package/dist/psych/visitors/emitter.js.map +1 -0
- package/dist/psych/visitors/to-ruby.d.ts +110 -0
- package/dist/psych/visitors/to-ruby.js +396 -0
- package/dist/psych/visitors/to-ruby.js.map +1 -0
- package/dist/psych/visitors/visitor.d.ts +11 -0
- package/dist/psych/visitors/visitor.js +17 -0
- package/dist/psych/visitors/visitor.js.map +1 -0
- package/dist/psych/visitors/yaml-tree.d.ts +182 -0
- package/dist/psych/visitors/yaml-tree.js +593 -0
- package/dist/psych/visitors/yaml-tree.js.map +1 -0
- package/dist/psych-adapter.d.ts +65 -0
- package/dist/psych-adapter.js +121 -0
- package/dist/psych-adapter.js.map +1 -0
- package/dist/psych-yaml.d.ts +2 -0
- package/dist/psych-yaml.js +5 -0
- package/dist/psych-yaml.js.map +1 -0
- package/dist/psych.d.ts +257 -0
- package/dist/psych.js +332 -0
- package/dist/psych.js.map +1 -0
- package/dist/queue.d.ts +137 -0
- package/dist/queue.js +236 -0
- package/dist/queue.js.map +1 -0
- package/dist/racc/parser.d.ts +70 -0
- package/dist/racc/parser.js +206 -0
- package/dist/racc/parser.js.map +1 -0
- package/dist/range-error.d.ts +15 -0
- package/dist/range-error.js +15 -0
- package/dist/range-error.js.map +1 -0
- package/dist/range.d.ts +166 -0
- package/dist/range.js +421 -0
- package/dist/range.js.map +1 -0
- package/dist/rational.d.ts +168 -0
- package/dist/rational.js +587 -0
- package/dist/rational.js.map +1 -0
- package/dist/rb-config.d.ts +33 -0
- package/dist/rb-config.js +53 -0
- package/dist/rb-config.js.map +1 -0
- package/dist/rb-equal.d.ts +66 -0
- package/dist/rb-equal.js +262 -0
- package/dist/rb-equal.js.map +1 -0
- package/dist/rb-hash.d.ts +26 -0
- package/dist/rb-hash.js +108 -0
- package/dist/rb-hash.js.map +1 -0
- package/dist/regexp.d.ts +82 -0
- package/dist/regexp.js +191 -0
- package/dist/regexp.js.map +1 -0
- package/dist/repl-adapter.d.ts +270 -0
- package/dist/repl-adapter.js +562 -0
- package/dist/repl-adapter.js.map +1 -0
- package/dist/resolv.d.ts +30 -0
- package/dist/resolv.js +48 -0
- package/dist/resolv.js.map +1 -0
- package/dist/ruby-empty.d.ts +28 -0
- package/dist/ruby-empty.js +40 -0
- package/dist/ruby-empty.js.map +1 -0
- package/dist/ruby-platform.d.ts +39 -0
- package/dist/ruby-platform.js +49 -0
- package/dist/ruby-platform.js.map +1 -0
- package/dist/runtime-error.d.ts +15 -0
- package/dist/runtime-error.js +15 -0
- package/dist/runtime-error.js.map +1 -0
- package/dist/scheduled-task.d.ts +73 -0
- package/dist/scheduled-task.js +150 -0
- package/dist/scheduled-task.js.map +1 -0
- package/dist/secure-random.d.ts +50 -0
- package/dist/secure-random.js +141 -0
- package/dist/secure-random.js.map +1 -0
- package/dist/set.d.ts +158 -0
- package/dist/set.js +352 -0
- package/dist/set.js.map +1 -0
- package/dist/shellwords.d.ts +27 -0
- package/dist/shellwords.js +53 -0
- package/dist/shellwords.js.map +1 -0
- package/dist/signal-exception.d.ts +43 -0
- package/dist/signal-exception.js +88 -0
- package/dist/signal-exception.js.map +1 -0
- package/dist/socket.d.ts +230 -0
- package/dist/socket.js +484 -0
- package/dist/socket.js.map +1 -0
- package/dist/standard-error.d.ts +27 -0
- package/dist/standard-error.js +49 -0
- package/dist/standard-error.js.map +1 -0
- package/dist/stop-iteration.d.ts +10 -0
- package/dist/stop-iteration.js +10 -0
- package/dist/stop-iteration.js.map +1 -0
- package/dist/string/b.d.ts +19 -0
- package/dist/string/b.js +28 -0
- package/dist/string/b.js.map +1 -0
- package/dist/string/byte-methods.d.ts +57 -0
- package/dist/string/byte-methods.js +266 -0
- package/dist/string/byte-methods.js.map +1 -0
- package/dist/string/bytes.d.ts +35 -0
- package/dist/string/bytes.js +123 -0
- package/dist/string/bytes.js.map +1 -0
- package/dist/string/case-mapping.d.ts +57 -0
- package/dist/string/case-mapping.js +192 -0
- package/dist/string/case-mapping.js.map +1 -0
- package/dist/string/chomp.d.ts +15 -0
- package/dist/string/chomp.js +32 -0
- package/dist/string/chomp.js.map +1 -0
- package/dist/string/convert.d.ts +55 -0
- package/dist/string/convert.js +316 -0
- package/dist/string/convert.js.map +1 -0
- package/dist/string/delete.d.ts +14 -0
- package/dist/string/delete.js +17 -0
- package/dist/string/delete.js.map +1 -0
- package/dist/string/each.d.ts +108 -0
- package/dist/string/each.js +305 -0
- package/dist/string/each.js.map +1 -0
- package/dist/string/encode.d.ts +37 -0
- package/dist/string/encode.js +268 -0
- package/dist/string/encode.js.map +1 -0
- package/dist/string/force-encoding.d.ts +72 -0
- package/dist/string/force-encoding.js +147 -0
- package/dist/string/force-encoding.js.map +1 -0
- package/dist/string/inspect.d.ts +17 -0
- package/dist/string/inspect.js +81 -0
- package/dist/string/inspect.js.map +1 -0
- package/dist/string/method-table.d.ts +174 -0
- package/dist/string/method-table.js +805 -0
- package/dist/string/method-table.js.map +1 -0
- package/dist/string/scrub.d.ts +12 -0
- package/dist/string/scrub.js +33 -0
- package/dist/string/scrub.js.map +1 -0
- package/dist/string/slice.d.ts +26 -0
- package/dist/string/slice.js +73 -0
- package/dist/string/slice.js.map +1 -0
- package/dist/string/split.d.ts +11 -0
- package/dist/string/split.js +44 -0
- package/dist/string/split.js.map +1 -0
- package/dist/string/sub.d.ts +114 -0
- package/dist/string/sub.js +371 -0
- package/dist/string/sub.js.map +1 -0
- package/dist/string/succ.d.ts +14 -0
- package/dist/string/succ.js +118 -0
- package/dist/string/succ.js.map +1 -0
- package/dist/string/support.d.ts +142 -0
- package/dist/string/support.js +296 -0
- package/dist/string/support.js.map +1 -0
- package/dist/string/tr.d.ts +46 -0
- package/dist/string/tr.js +156 -0
- package/dist/string/tr.js.map +1 -0
- package/dist/string-io.d.ts +166 -0
- package/dist/string-io.js +248 -0
- package/dist/string-io.js.map +1 -0
- package/dist/string-scanner.d.ts +133 -0
- package/dist/string-scanner.js +248 -0
- package/dist/string-scanner.js.map +1 -0
- package/dist/struct.d.ts +54 -0
- package/dist/struct.js +222 -0
- package/dist/struct.js.map +1 -0
- package/dist/symbol.d.ts +48 -0
- package/dist/symbol.js +107 -0
- package/dist/symbol.js.map +1 -0
- package/dist/tempfile.d.ts +173 -0
- package/dist/tempfile.js +295 -0
- package/dist/tempfile.js.map +1 -0
- package/dist/temporal-tag.d.ts +23 -0
- package/dist/temporal-tag.js +29 -0
- package/dist/temporal-tag.js.map +1 -0
- package/dist/thread-error.d.ts +13 -0
- package/dist/thread-error.js +13 -0
- package/dist/thread-error.js.map +1 -0
- package/dist/thread-pool-executor.d.ts +121 -0
- package/dist/thread-pool-executor.js +254 -0
- package/dist/thread-pool-executor.js.map +1 -0
- package/dist/thread.d.ts +211 -0
- package/dist/thread.js +495 -0
- package/dist/thread.js.map +1 -0
- package/dist/timeout.d.ts +29 -0
- package/dist/timeout.js +41 -0
- package/dist/timeout.js.map +1 -0
- package/dist/tse.d.ts +40 -0
- package/dist/tse.js +66 -0
- package/dist/tse.js.map +1 -0
- package/dist/type-error.d.ts +14 -0
- package/dist/type-error.js +14 -0
- package/dist/type-error.js.map +1 -0
- package/dist/undefined-conversion-error.d.ts +10 -0
- package/dist/undefined-conversion-error.js +10 -0
- package/dist/undefined-conversion-error.js.map +1 -0
- package/dist/uri/common.d.ts +209 -0
- package/dist/uri/common.js +369 -0
- package/dist/uri/common.js.map +1 -0
- package/dist/uri/generic.d.ts +280 -0
- package/dist/uri/generic.js +806 -0
- package/dist/uri/generic.js.map +1 -0
- package/dist/uri/http.d.ts +23 -0
- package/dist/uri/http.js +30 -0
- package/dist/uri/http.js.map +1 -0
- package/dist/uri/https.d.ts +13 -0
- package/dist/uri/https.js +15 -0
- package/dist/uri/https.js.map +1 -0
- package/dist/uri/rfc2396-parser.d.ts +70 -0
- package/dist/uri/rfc2396-parser.js +264 -0
- package/dist/uri/rfc2396-parser.js.map +1 -0
- package/dist/uri/rfc3986-parser.d.ts +46 -0
- package/dist/uri/rfc3986-parser.js +171 -0
- package/dist/uri/rfc3986-parser.js.map +1 -0
- package/dist/uri.d.ts +13 -0
- package/dist/uri.js +13 -0
- package/dist/uri.js.map +1 -0
- package/dist/variable.d.ts +183 -0
- package/dist/variable.js +463 -0
- package/dist/variable.js.map +1 -0
- package/dist/verbose.d.ts +39 -0
- package/dist/verbose.js +49 -0
- package/dist/verbose.js.map +1 -0
- package/dist/yaml.d.ts +9 -0
- package/dist/yaml.js +9 -0
- package/dist/yaml.js.map +1 -0
- package/dist/zlib-adapter.d.ts +119 -0
- package/dist/zlib-adapter.js +230 -0
- package/dist/zlib-adapter.js.map +1 -0
- package/dist/zlib.d.ts +299 -0
- package/dist/zlib.js +679 -0
- package/dist/zlib.js.map +1 -0
- package/package.json +172 -3
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mirrors: MRI's `rb_clear_method_cache` — vendor/ruby/v3.3.11/vm_method.c:295,
|
|
3
|
+
* which every method-table or ancestry change calls so a call cache keyed on
|
|
4
|
+
* the old table misses. trails keeps one serial for every class: a cache reads
|
|
5
|
+
* {@link methodCacheSerial} and is stale once it differs.
|
|
6
|
+
*
|
|
7
|
+
* @noRailsEquivalent PERMANENT
|
|
8
|
+
* @perf 100ns — PERMANENT
|
|
9
|
+
*/
|
|
10
|
+
export let methodCacheSerial = 0;
|
|
11
|
+
/**
|
|
12
|
+
* `rb_clear_method_cache` (`vendor/ruby/v3.3.11/vm_method.c:295`).
|
|
13
|
+
*
|
|
14
|
+
* @noRailsEquivalent PERMANENT
|
|
15
|
+
*/
|
|
16
|
+
export function rbClearMethodCache() {
|
|
17
|
+
methodCacheSerial++;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Each method's `super` slot, which {@link rbSeatSuper} writes and
|
|
21
|
+
* `rbCallSuper` reads (MRI `vm_search_super_method`,
|
|
22
|
+
* `vendor/ruby/v3.3.11/vm_insnhelper.c:4680`).
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
* @noRailsEquivalent PERMANENT
|
|
26
|
+
*/
|
|
27
|
+
export const superSlots = new WeakMap();
|
|
28
|
+
/**
|
|
29
|
+
* A method's own copy of its {@link superSlots} slot (MRI
|
|
30
|
+
* `vm_search_super_method`, `vendor/ruby/v3.3.11/vm_insnhelper.c:4680`).
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
* @noRailsEquivalent PERMANENT
|
|
34
|
+
* @perf 10ns — PERMANENT
|
|
35
|
+
*/
|
|
36
|
+
export const _superSlot = Symbol("superSlot");
|
|
37
|
+
/**
|
|
38
|
+
* `method`'s entry in {@link superSlots}, made on first use under the `key`
|
|
39
|
+
* it is being installed as, the `original_id` MRI's `vm_search_super_method`
|
|
40
|
+
* (`vendor/ruby/v3.3.11/vm_insnhelper.c:4680`) searches by.
|
|
41
|
+
*
|
|
42
|
+
* @internal
|
|
43
|
+
* @noRailsEquivalent PERMANENT
|
|
44
|
+
*/
|
|
45
|
+
export function superSlotFor(method, key) {
|
|
46
|
+
let entry = superSlots.get(method);
|
|
47
|
+
if (entry === undefined) {
|
|
48
|
+
superSlots.set(method, (entry = { slot: Symbol(`super:${key}`), key }));
|
|
49
|
+
if (Object.isExtensible(method))
|
|
50
|
+
Object.defineProperty(method, _superSlot, { value: entry.slot });
|
|
51
|
+
}
|
|
52
|
+
return entry;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Seats on `target`, in `descriptors`, the `key` method `method` is about to
|
|
56
|
+
* shadow, for {@link rbCallSuper}. A function keeps the key it was first
|
|
57
|
+
* installed under, as MRI's `super` searches by the method's `original_id`
|
|
58
|
+
* (`vendor/ruby/v3.3.11/vm_insnhelper.c:4680`, `vm_search_super_method`).
|
|
59
|
+
* An accessor's `get` and `set` are seated one `half` at a time, as Ruby's
|
|
60
|
+
* `name` and `name=` are two methods.
|
|
61
|
+
*
|
|
62
|
+
* @noRailsEquivalent PERMANENT
|
|
63
|
+
*/
|
|
64
|
+
export function rbSeatSuper(target, key, method, descriptors, half = "value") {
|
|
65
|
+
if (typeof method !== "function")
|
|
66
|
+
return;
|
|
67
|
+
let shadowed;
|
|
68
|
+
for (let link = target; link; link = Object.getPrototypeOf(link)) {
|
|
69
|
+
const desc = Object.getOwnPropertyDescriptor(link, key);
|
|
70
|
+
if (desc && (half === "value" || desc[half] !== undefined)) {
|
|
71
|
+
shadowed = desc[half];
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (typeof shadowed !== "function" || shadowed === method)
|
|
76
|
+
return;
|
|
77
|
+
const entry = superSlotFor(method, key);
|
|
78
|
+
if (Object.hasOwn(descriptors, entry.slot))
|
|
79
|
+
return;
|
|
80
|
+
descriptors[entry.slot] = { value: shadowed, configurable: true };
|
|
81
|
+
entry.seats = (entry.seats ?? 0) + 1;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* `Module#define_method` on a class receiver (`rb_mod_define_method`,
|
|
85
|
+
* `vendor/ruby/v3.3.11/proc.c:2325`): binds `body` as `mod`'s instance method
|
|
86
|
+
* `mid`. `body` is the block, or the method `define_method(symbol, method)`
|
|
87
|
+
* takes, whose JS carrier is a property descriptor (see
|
|
88
|
+
* `Module#instanceMethod`), so a zero-argument reader can be defined as the
|
|
89
|
+
* accessor it ports to. A JS class has no metaclass apart from its own
|
|
90
|
+
* statics (CLAUDE.md, "`singleton_class` is a per-object subclass"), so a
|
|
91
|
+
* class's `singleton_class.define_method` passes `{ prototype: klass }`.
|
|
92
|
+
*
|
|
93
|
+
* It replaces `mod`'s own `mid`, and its `super` reaches the next `mid` in
|
|
94
|
+
* the ancestry ({@link rbCallSuper}).
|
|
95
|
+
*
|
|
96
|
+
* @noRailsEquivalent PERMANENT
|
|
97
|
+
*/
|
|
98
|
+
export function rbModDefineMethod(mod, mid, body) {
|
|
99
|
+
const descriptors = {
|
|
100
|
+
[mid]: typeof body === "function"
|
|
101
|
+
? { value: body, writable: true, configurable: true }
|
|
102
|
+
: { configurable: true, ...body },
|
|
103
|
+
};
|
|
104
|
+
rbSeatSuper(Object.getPrototypeOf(mod.prototype), mid, typeof body === "function" ? body : body.value, descriptors);
|
|
105
|
+
Object.defineProperties(mod.prototype, descriptors);
|
|
106
|
+
rbClearMethodCache();
|
|
107
|
+
return mid;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=method-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-cache.js","sourceRoot":"","sources":["../lib/method-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,IAAI,iBAAiB,GAAG,CAAC,CAAC;AAEjC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,iBAAiB,EAAE,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,OAAO,EAGlC,CAAC;AAEJ;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAqC,EACrC,GAAW;IAEX,IAAI,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACnC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,UAAU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E,IAAI,EAAE,CAAC;IAClE,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAA0B,EAC1B,GAAW,EACX,IAA0D;IAE1D,MAAM,WAAW,GAA0B;QACzC,CAAC,GAAG,CAAC,EACH,OAAO,IAAI,KAAK,UAAU;YACxB,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE;YACrD,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE;KACtC,CAAC;IACF,WAAW,CACT,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAW,EAC9C,GAAG,EACH,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAC9C,WAAW,CACZ,CAAC;IACF,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACpD,kBAAkB,EAAE,CAAC;IACrB,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Names a probe reads off an arbitrary object and then *calls*, where Ruby's
|
|
3
|
+
* `method_missing` is never reached. Two kinds:
|
|
4
|
+
*
|
|
5
|
+
* - what JS itself probes to decide whether an object implements a protocol —
|
|
6
|
+
* `await x` reads `then`, structured comparison reads `toJSON`, vitest's
|
|
7
|
+
* matchers read `asymmetricMatch`/`$$typeof`;
|
|
8
|
+
* - what Ruby answers from `Object` itself, so the send resolves before
|
|
9
|
+
* `method_missing`: `Object#blank?` (`activesupport/lib/active_support/core_ext/object/blank.rb:16-18`)
|
|
10
|
+
* is a real public method on every object, and it in turn asks
|
|
11
|
+
* `respond_to?(:empty?)` — trails spells both as the free functions `isBlank`
|
|
12
|
+
* / `isEmpty`, which read the member off the receiver instead.
|
|
13
|
+
*
|
|
14
|
+
* A raising function in those slots would be *called* by the probe, so they
|
|
15
|
+
* stay absent. A name the delegate really answers is forwarded before this set
|
|
16
|
+
* is consulted, so nothing real is suppressed.
|
|
17
|
+
*
|
|
18
|
+
* @noRailsEquivalent PERMANENT — Ruby resolves an undefined method through `method_missing`
|
|
19
|
+
* (`vendor/ruby/v3.3.11/vm_eval.c:2570`), JS has only `Proxy`, and a `get` trap must
|
|
20
|
+
* stay silent for the names JS itself probes. Exported so the other
|
|
21
|
+
* `method_missing` mirrors — `Delegation.generate_method_missing`'s trap and
|
|
22
|
+
* `Deprecation::Proxy`'s — read the one list rather than repeating it.
|
|
23
|
+
*/
|
|
24
|
+
export declare const PROTOCOL_PROBES: Set<string>;
|
|
25
|
+
/**
|
|
26
|
+
* The public methods `Kernel` defines on every object (`vendor/ruby/v3.3.11/object.c:4360`,
|
|
27
|
+
* `Init_Object` at `:4527`), camelCased as trails spells them. Ruby finds them
|
|
28
|
+
* on the receiver before `method_missing` is consulted, so a trap forwarding
|
|
29
|
+
* to a delegate must not forward these: `chars.eql?(chars)` is Kernel's
|
|
30
|
+
* identity test, never the wrapped String's.
|
|
31
|
+
*
|
|
32
|
+
* @noRailsEquivalent PERMANENT
|
|
33
|
+
*/
|
|
34
|
+
export declare const KERNEL_METHODS: Set<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Mirrors the dispatch to `method_missing` (`vendor/ruby/v3.3.11/vm_eval.c:2570`) for a
|
|
37
|
+
* class whose `methodMissing` forwards to a delegate. A name the delegate answers
|
|
38
|
+
* is read off it, so a reader returns its value; any other name returns a
|
|
39
|
+
* function calling `receiver.methodMissing`. A read off a prototype (an own
|
|
40
|
+
* `constructor`) and an `_`-prefixed name, trails' private spelling, are not
|
|
41
|
+
* dispatched, as `respondsTo` above answers neither.
|
|
42
|
+
*
|
|
43
|
+
* @noRailsEquivalent PERMANENT
|
|
44
|
+
*/
|
|
45
|
+
export declare function methodMissingPrototype<T extends {
|
|
46
|
+
methodMissing(m: string, ...args: unknown[]): unknown;
|
|
47
|
+
}>(klass: {
|
|
48
|
+
prototype: T;
|
|
49
|
+
}, options: {
|
|
50
|
+
delegate: (receiver: T) => unknown;
|
|
51
|
+
wrap?: (receiver: T, result: unknown) => unknown;
|
|
52
|
+
}): void;
|
|
53
|
+
//# sourceMappingURL=method-missing-proxy.d.ts.map
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Names a probe reads off an arbitrary object and then *calls*, where Ruby's
|
|
3
|
+
* `method_missing` is never reached. Two kinds:
|
|
4
|
+
*
|
|
5
|
+
* - what JS itself probes to decide whether an object implements a protocol —
|
|
6
|
+
* `await x` reads `then`, structured comparison reads `toJSON`, vitest's
|
|
7
|
+
* matchers read `asymmetricMatch`/`$$typeof`;
|
|
8
|
+
* - what Ruby answers from `Object` itself, so the send resolves before
|
|
9
|
+
* `method_missing`: `Object#blank?` (`activesupport/lib/active_support/core_ext/object/blank.rb:16-18`)
|
|
10
|
+
* is a real public method on every object, and it in turn asks
|
|
11
|
+
* `respond_to?(:empty?)` — trails spells both as the free functions `isBlank`
|
|
12
|
+
* / `isEmpty`, which read the member off the receiver instead.
|
|
13
|
+
*
|
|
14
|
+
* A raising function in those slots would be *called* by the probe, so they
|
|
15
|
+
* stay absent. A name the delegate really answers is forwarded before this set
|
|
16
|
+
* is consulted, so nothing real is suppressed.
|
|
17
|
+
*
|
|
18
|
+
* @noRailsEquivalent PERMANENT — Ruby resolves an undefined method through `method_missing`
|
|
19
|
+
* (`vendor/ruby/v3.3.11/vm_eval.c:2570`), JS has only `Proxy`, and a `get` trap must
|
|
20
|
+
* stay silent for the names JS itself probes. Exported so the other
|
|
21
|
+
* `method_missing` mirrors — `Delegation.generate_method_missing`'s trap and
|
|
22
|
+
* `Deprecation::Proxy`'s — read the one list rather than repeating it.
|
|
23
|
+
*/
|
|
24
|
+
export const PROTOCOL_PROBES = new Set([
|
|
25
|
+
"then",
|
|
26
|
+
"catch",
|
|
27
|
+
"finally",
|
|
28
|
+
"toJSON",
|
|
29
|
+
"asymmetricMatch",
|
|
30
|
+
"$$typeof",
|
|
31
|
+
"nodeType",
|
|
32
|
+
"hasAttribute",
|
|
33
|
+
"isBlank",
|
|
34
|
+
"isEmpty",
|
|
35
|
+
"empty",
|
|
36
|
+
]);
|
|
37
|
+
/**
|
|
38
|
+
* The public methods `Kernel` defines on every object (`vendor/ruby/v3.3.11/object.c:4360`,
|
|
39
|
+
* `Init_Object` at `:4527`), camelCased as trails spells them. Ruby finds them
|
|
40
|
+
* on the receiver before `method_missing` is consulted, so a trap forwarding
|
|
41
|
+
* to a delegate must not forward these: `chars.eql?(chars)` is Kernel's
|
|
42
|
+
* identity test, never the wrapped String's.
|
|
43
|
+
*
|
|
44
|
+
* @noRailsEquivalent PERMANENT
|
|
45
|
+
*/
|
|
46
|
+
export const KERNEL_METHODS = new Set([
|
|
47
|
+
"isNil",
|
|
48
|
+
"caseEquals",
|
|
49
|
+
"eql",
|
|
50
|
+
"hash",
|
|
51
|
+
"compareTo",
|
|
52
|
+
"singletonClass",
|
|
53
|
+
"dup",
|
|
54
|
+
"itself",
|
|
55
|
+
"freeze",
|
|
56
|
+
"isFrozen",
|
|
57
|
+
"clone",
|
|
58
|
+
"toS",
|
|
59
|
+
"inspect",
|
|
60
|
+
"methods",
|
|
61
|
+
"singletonMethods",
|
|
62
|
+
"protectedMethods",
|
|
63
|
+
"privateMethods",
|
|
64
|
+
"publicMethods",
|
|
65
|
+
"instanceVariables",
|
|
66
|
+
"instanceVariableGet",
|
|
67
|
+
"instanceVariableSet",
|
|
68
|
+
"isInstanceVariableDefined",
|
|
69
|
+
"removeInstanceVariable",
|
|
70
|
+
"isInstanceOf",
|
|
71
|
+
"isKindOf",
|
|
72
|
+
"isA",
|
|
73
|
+
"tap",
|
|
74
|
+
"then",
|
|
75
|
+
"yieldSelf",
|
|
76
|
+
"send",
|
|
77
|
+
"publicSend",
|
|
78
|
+
"isRespondTo",
|
|
79
|
+
"method",
|
|
80
|
+
"publicMethod",
|
|
81
|
+
"singletonMethod",
|
|
82
|
+
"defineSingletonMethod",
|
|
83
|
+
"objectId",
|
|
84
|
+
"display",
|
|
85
|
+
"extend",
|
|
86
|
+
"enumFor",
|
|
87
|
+
"toEnum",
|
|
88
|
+
"isEqual",
|
|
89
|
+
"equals",
|
|
90
|
+
"instanceEval",
|
|
91
|
+
"instanceExec",
|
|
92
|
+
]);
|
|
93
|
+
/**
|
|
94
|
+
* Mirrors `Kernel#respond_to?` (`vendor/ruby/v3.3.11/vm_method.c:3017`) — public
|
|
95
|
+
* members only, as its `include_all = false` default is.
|
|
96
|
+
*/
|
|
97
|
+
function respondsTo(delegate, prop) {
|
|
98
|
+
if (delegate == null)
|
|
99
|
+
return false;
|
|
100
|
+
if (typeof prop === "string" && prop.startsWith("_"))
|
|
101
|
+
return false;
|
|
102
|
+
return prop in Object(delegate);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Whether `prop` resolves to a method rather than a reader: Ruby's
|
|
106
|
+
* `target.__send__(m)` (`vendor/ruby/v3.3.11/lib/delegate.rb:88`) returns a reader's
|
|
107
|
+
* value as-is, so only a data descriptor on the delegate's prototype chain is
|
|
108
|
+
* bound — a getter returning a class hands back the class itself.
|
|
109
|
+
*/
|
|
110
|
+
function isMethod(delegate, prop) {
|
|
111
|
+
for (let owner = delegate; owner; owner = Object.getPrototypeOf(owner)) {
|
|
112
|
+
const descriptor = Object.getOwnPropertyDescriptor(owner, prop);
|
|
113
|
+
if (descriptor)
|
|
114
|
+
return "value" in descriptor;
|
|
115
|
+
}
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Mirrors the dispatch to `method_missing` (`vendor/ruby/v3.3.11/vm_eval.c:2570`) for a
|
|
120
|
+
* class whose `methodMissing` forwards to a delegate. A name the delegate answers
|
|
121
|
+
* is read off it, so a reader returns its value; any other name returns a
|
|
122
|
+
* function calling `receiver.methodMissing`. A read off a prototype (an own
|
|
123
|
+
* `constructor`) and an `_`-prefixed name, trails' private spelling, are not
|
|
124
|
+
* dispatched, as `respondsTo` above answers neither.
|
|
125
|
+
*
|
|
126
|
+
* @noRailsEquivalent PERMANENT
|
|
127
|
+
*/
|
|
128
|
+
export function methodMissingPrototype(klass, options) {
|
|
129
|
+
const { delegate: readDelegate, wrap } = options;
|
|
130
|
+
const parent = Object.getPrototypeOf(klass.prototype);
|
|
131
|
+
Object.setPrototypeOf(klass.prototype, new Proxy(Object.create(parent), {
|
|
132
|
+
get(target, prop, receiver) {
|
|
133
|
+
if (Reflect.has(target, prop) ||
|
|
134
|
+
Object.hasOwn(receiver, "constructor") ||
|
|
135
|
+
(typeof prop === "string" && prop.startsWith("_"))) {
|
|
136
|
+
return Reflect.get(target, prop, receiver);
|
|
137
|
+
}
|
|
138
|
+
const delegate = readDelegate(receiver);
|
|
139
|
+
if (respondsTo(delegate, prop)) {
|
|
140
|
+
const value = delegate[prop];
|
|
141
|
+
if (typeof value !== "function" || !isMethod(delegate, prop))
|
|
142
|
+
return value;
|
|
143
|
+
if (wrap === undefined)
|
|
144
|
+
return value.bind(delegate);
|
|
145
|
+
return (...args) => wrap(receiver, value.apply(delegate, args));
|
|
146
|
+
}
|
|
147
|
+
if (typeof prop === "symbol" || PROTOCOL_PROBES.has(prop) || KERNEL_METHODS.has(prop)) {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
return (...args) => receiver.methodMissing(prop, ...args);
|
|
151
|
+
},
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=method-missing-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-missing-proxy.js","sourceRoot":"","sources":["../lib/method-missing-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsB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AI,KAAK,SAAS;oBAAE,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACpD,OAAO,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;YAC7E,CAAC;YACD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACtF,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,OAAO,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QACvE,CAAC;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/method.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ruby core `Method` (`vendor/ruby/v3.3.11/proc.c:1657` `mnew_missing` builds the
|
|
3
|
+
* `method_missing`-backed kind): a method bound to its receiver.
|
|
4
|
+
*
|
|
5
|
+
* @noRailsEquivalent PERMANENT
|
|
6
|
+
*/
|
|
7
|
+
export declare class Method {
|
|
8
|
+
#private;
|
|
9
|
+
/**
|
|
10
|
+
* `mnew_internal` (`vendor/ruby/v3.3.11/proc.c:1689`): the receiver, name and body a
|
|
11
|
+
* `Method` binds.
|
|
12
|
+
*
|
|
13
|
+
* @noRailsEquivalent PERMANENT
|
|
14
|
+
*/
|
|
15
|
+
constructor(receiver: unknown, name: string, func: (...args: unknown[]) => unknown);
|
|
16
|
+
/**
|
|
17
|
+
* `Method#call` (`vendor/ruby/v3.3.11/proc.c:2500` `rb_method_call`).
|
|
18
|
+
*
|
|
19
|
+
* @noRailsEquivalent PERMANENT
|
|
20
|
+
*/
|
|
21
|
+
call(...args: unknown[]): unknown;
|
|
22
|
+
/**
|
|
23
|
+
* `Method#receiver` (`vendor/ruby/v3.3.11/proc.c:1923` `method_receiver`).
|
|
24
|
+
*
|
|
25
|
+
* @noRailsEquivalent PERMANENT
|
|
26
|
+
*/
|
|
27
|
+
receiver(): unknown;
|
|
28
|
+
/**
|
|
29
|
+
* `Method#name` (`vendor/ruby/v3.3.11/proc.c:1939` `method_name`).
|
|
30
|
+
*
|
|
31
|
+
* @noRailsEquivalent PERMANENT
|
|
32
|
+
*/
|
|
33
|
+
name(): string;
|
|
34
|
+
/**
|
|
35
|
+
* `Method#owner` (`vendor/ruby/v3.3.11/proc.c:1988` `method_owner`): the class or
|
|
36
|
+
* module that defines the method. A class's own static stands for a method
|
|
37
|
+
* of its singleton class, and is owned by the class.
|
|
38
|
+
*
|
|
39
|
+
* @noRailsEquivalent PERMANENT
|
|
40
|
+
*/
|
|
41
|
+
owner(): object;
|
|
42
|
+
/**
|
|
43
|
+
* `Method#arity` (`vendor/ruby/v3.3.11/proc.c:2872` `method_arity`, over
|
|
44
|
+
* `method_def_arity` at `:2808`): the required count when it is also the
|
|
45
|
+
* maximum, else `-min-1`.
|
|
46
|
+
*
|
|
47
|
+
* @noRailsEquivalent PERMANENT
|
|
48
|
+
*/
|
|
49
|
+
arity(): number;
|
|
50
|
+
/**
|
|
51
|
+
* `Method#parameters` (`vendor/ruby/v3.3.11/proc.c:3103` `rb_method_parameters`,
|
|
52
|
+
* over `rb_iseq_parameters` at `iseq.c:3334`): a `[type, name]` pair per
|
|
53
|
+
* parameter, `:req`, `:opt`, `:rest`, `:key`, `:keyreq` or `:keyrest`, each a
|
|
54
|
+
* Symbol. See {@link rbIseqParameters} for how keywords are read.
|
|
55
|
+
*
|
|
56
|
+
* @noRailsEquivalent PERMANENT
|
|
57
|
+
*/
|
|
58
|
+
parameters(): ([string] | [string, string])[];
|
|
59
|
+
/**
|
|
60
|
+
* `Method#source_location` (`vendor/ruby/v3.3.11/proc.c:3015` `rb_method_location`):
|
|
61
|
+
* `[path, first_lineno]`, or `nil` for a body no {@link iseqLocationSetup} located.
|
|
62
|
+
*
|
|
63
|
+
* @noRailsEquivalent PERMANENT
|
|
64
|
+
*/
|
|
65
|
+
sourceLocation(): [string, number] | null;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* `iseq_location_setup` (`vendor/ruby/v3.3.11/iseq.c:550`): the `path` and
|
|
69
|
+
* `first_lineno` of a body, which a JS function does not expose by itself.
|
|
70
|
+
*
|
|
71
|
+
* @noRailsEquivalent PERMANENT
|
|
72
|
+
*/
|
|
73
|
+
export declare function iseqLocationSetup(iseq: (...args: never[]) => unknown, path: string, firstLineno: number): void;
|
|
74
|
+
/**
|
|
75
|
+
* `Kernel#method` (`vendor/ruby/v3.3.11/proc.c:2079` `rb_obj_method`, over `obj_method`
|
|
76
|
+
* at `:2025`): the receiver's own method, else a `method_missing`-backed one
|
|
77
|
+
* when `respond_to_missing?` answers for the name (`mnew_missing_by_name`,
|
|
78
|
+
* `:1680`), else `rb_method_name_error`'s `NameError` (`:1996`). The name is
|
|
79
|
+
* a Symbol (`":name"`) or a String, as `rb_check_id`
|
|
80
|
+
* (`vendor/ruby/v3.3.11/symbol.c:1096`) takes it.
|
|
81
|
+
*
|
|
82
|
+
* @inventedArm if — PERMANENT
|
|
83
|
+
* @noRailsEquivalent PERMANENT
|
|
84
|
+
*/
|
|
85
|
+
export declare function rbObjMethod(obj: unknown, vid: unknown): Method;
|
|
86
|
+
/**
|
|
87
|
+
* `Object#methods` (`vendor/ruby/v3.3.11/class.c:1993` `rb_obj_methods`): the
|
|
88
|
+
* names of the receiver's methods. A JS entry carries no visibility, so it is
|
|
89
|
+
* also `public_methods`, and a false `recur` lists the singleton's and its own
|
|
90
|
+
* class's alone, as `public_methods(false)` does (`class.c:2042`).
|
|
91
|
+
*
|
|
92
|
+
* @inventedArm if — PERMANENT
|
|
93
|
+
* @noRailsEquivalent PERMANENT
|
|
94
|
+
*/
|
|
95
|
+
export declare function rbObjMethods(obj: unknown, recur?: boolean): string[];
|
|
96
|
+
/**
|
|
97
|
+
* `rb_iseq_min_max_arity` (`vendor/ruby/v3.3.11/proc.c:1069`): a body's
|
|
98
|
+
* `[min, max]` argument counts, `max` `Infinity` for `UNLIMITED_ARGUMENTS`
|
|
99
|
+
* once a rest parameter appears. JS `Function#length` stops counting at the
|
|
100
|
+
* first default, so `(gid)` and `(gid, options = {})` both report 1; the
|
|
101
|
+
* parameter list is read from the function's source instead.
|
|
102
|
+
*
|
|
103
|
+
* @noRailsEquivalent PERMANENT
|
|
104
|
+
*/
|
|
105
|
+
export declare function rbIseqMinMaxArity(func: (...args: never[]) => unknown): [number, number];
|
|
106
|
+
/**
|
|
107
|
+
* `rb_iseq_parameters` (`vendor/ruby/v3.3.11/iseq.c:3334`): a `[type, name]`
|
|
108
|
+
* pair per parameter, `:req`, `:opt`, `:rest`, `:key` or `:keyreq`, each a
|
|
109
|
+
* Symbol, read here from the function's source. A trailing destructured object,
|
|
110
|
+
* trails' kwargs idiom, answers its keys as keywords: `:key` with a default,
|
|
111
|
+
* `:keyreq` without, `:keyrest` for a `...rest` member, each named by its key.
|
|
112
|
+
* One without a default whose keys all have defaults stays a `:req`
|
|
113
|
+
* positional, because JS requires the argument and no Ruby keyword shape
|
|
114
|
+
* does. Any other destructured parameter has no name and answers its type
|
|
115
|
+
* alone.
|
|
116
|
+
*
|
|
117
|
+
* @noRailsEquivalent PERMANENT
|
|
118
|
+
*/
|
|
119
|
+
export declare function rbIseqParameters(iseq: (...args: never[]) => unknown): ([string] | [string, string])[];
|
|
120
|
+
/**
|
|
121
|
+
* `argument_arity_error` (`vendor/ruby/v3.3.11/vm_args.c:800`), raised where
|
|
122
|
+
* `setup_parameters_complex` finds `argc` outside the callee's range. JS never
|
|
123
|
+
* checks call arity (a missing argument is `undefined`, an extra one is
|
|
124
|
+
* dropped), so a caller whose Ruby body rescues that `ArgumentError` checks
|
|
125
|
+
* the body's parameter list before sending. `raise_argument_error` (`:777`)
|
|
126
|
+
* takes the backtrace at the call, so the error's begins at this function's
|
|
127
|
+
* caller.
|
|
128
|
+
*
|
|
129
|
+
* @noRailsEquivalent PERMANENT
|
|
130
|
+
*/
|
|
131
|
+
export declare function rbCheckArity(method: (...args: never[]) => unknown, argc: number): void;
|
|
132
|
+
//# sourceMappingURL=method.d.ts.map
|