homura-runtime 0.2.13 → 0.2.15

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fcb680263cc614fbab274bca4c5fb543190eaed082f89027f164271d53823b3c
4
- data.tar.gz: 6a27e35387f0712257727c082d5e938e92a0c8501b9dbae039966a608bdd44f8
3
+ metadata.gz: 694836eb27a5ada6280795e386907320274633bcc5d1c6c06c923946d6f25d4a
4
+ data.tar.gz: bfdf7f444a17af66deff9ebe693c1251c1a8215b0dc48bde5fd050afc0c21c7b
5
5
  SHA512:
6
- metadata.gz: 73df80bf976afee41fb737ed791a14c91b5236d1ae9a7fc2e851cb4a7eb949a9a459b525c32f9384c38bbaf175ad0ce00055d745c09daf1ba6702dd822cfbc0a
7
- data.tar.gz: 0ab6bf2f93f9fae328f3850ee690120b21a62af0b49617f854e221db329844f21d4903f57de46271e29fde6b092b963b8c4bdae6d43a9c4a96bf3d2af269a26d
6
+ metadata.gz: a9137328c2e78d8fd8911cf704f3fd2431d193a5ef798aa5f54eb8d8d10a9d40647df0eafcd53d26903ad6fbca18ddb27fc2ad14df44514aa5d29e8541da1e1b
7
+ data.tar.gz: 1ae649dca3329e6ba13d2690a989842388702d0ee2b8788ca4bcd38fdbc69e141a0dd62f0f3cc73d4141973a7945170d572a674d30b6d2b75efa00e351642c08
@@ -148,6 +148,13 @@ CloudflareWorkers::AsyncRegistry.register_async_source do
148
148
  async_method 'Cloudflare::D1Statement', :all
149
149
  async_method 'Cloudflare::D1Statement', :first
150
150
  async_method 'Cloudflare::D1Statement', :run
151
+ # `bind` returns a new D1Statement for further chaining. Tainting the
152
+ # return preserves the type so the auto-await pass keeps chaining
153
+ # `.run` / `.all` / `.first` on the bound statement (otherwise
154
+ # `db.prepare(sql).bind(...).run` drops await on `.run` and
155
+ # `flatten_meta` ends up receiving a JS Promise instead of the
156
+ # metadata Hash).
157
+ taint_return 'Cloudflare::D1Statement', :bind, 'Cloudflare::D1Statement'
151
158
 
152
159
  async_method 'Cloudflare::KVNamespace', :get
153
160
  async_method 'Cloudflare::KVNamespace', :get_with_metadata
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudflareWorkers
4
- VERSION = '0.2.13'
4
+ VERSION = '0.2.15'
5
5
  end
data/lib/opal_patches.rb CHANGED
@@ -456,10 +456,12 @@ module ::SecureRandom
456
456
  padding ? s : s.delete('=')
457
457
  end
458
458
 
459
- def self.random_number(n = 0)
460
- # Not used at class-init time; real implementations welcome.
461
- 0
462
- end
459
+ # NOTE: `SecureRandom.random_number` is provided by `Random::Formatter`
460
+ # (extended into `SecureRandom` by stdlib/securerandom.rb). Defining a
461
+ # `self.random_number` stub here used to shadow that real implementation
462
+ # and pin the result to `0`, which silently broke any caller that did
463
+ # the canonical `format('%06d', SecureRandom.random_number(1_000_000))`.
464
+ # Leave the formatter implementation alone; do NOT redefine here.
463
465
 
464
466
  # Returns a hex string of `n` random bytes, or nil when no entropy
465
467
  # source is available. Tries node:crypto.randomBytes first (works
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homura-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuhiro Homma