sorbet-runtime 0.6.12534 → 0.6.12549

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: 1900ecda1ce9ca314432d848c560bae9b92a3c2e7bc35b4f5ffe22de96b52f0a
4
- data.tar.gz: 6998645309e0a99fafc14a1aafefff0ecd89c73d3c67d9a2888a7d363dd5edbd
3
+ metadata.gz: 3bb86474db1fb980a55d7e0fd897d0ac8675f48332641a0edf81b2767be159fa
4
+ data.tar.gz: e581bbe0a5538bf239f927bb724cf98a5e3ae0ad7040e8d8afb01091667bc048
5
5
  SHA512:
6
- metadata.gz: 835eb9ce4cf8d80e75e81ec0fb960b886d6eaec5164dd87fff5e992a0dc0116c888be1f822828d45be0a9b345de15a0dc06b270c91303fe91fe3a2180d3a1af0
7
- data.tar.gz: db8644d8f53f632b6b302341af7299d776accd4ec46b937e0217f909eca5ae908763b658c475ad0cbae46c850061bb54207dbf4b223343a5987449078f6e4555
6
+ metadata.gz: 786ee1df865150b89548583d0f19a6a248b7bb3dddb27a6648da9c5f7e12057ad8011c4b4b1bc718595eea4284a6df88a4e06686fa15570682d941d599d59347
7
+ data.tar.gz: e92f0b363f335eeba8e0c20acb7ccc5fde216faf520e36de72cfd1a852635416e58bf46e51791e2389197fed0a81162f10474401150b68478eccdc4ead2c26bb
@@ -546,16 +546,6 @@ module T::Configuration
546
546
  @legacy_t_enum_migration_mode || false
547
547
  end
548
548
 
549
- @prop_freeze_handler = ->(instance, prop_name) {}
550
-
551
- def self.prop_freeze_handler=(handler)
552
- @prop_freeze_handler = handler
553
- end
554
-
555
- def self.prop_freeze_handler
556
- @prop_freeze_handler
557
- end
558
-
559
549
  @sealed_violation_whitelist = nil
560
550
  # @param [Array] sealed_violation_whitelist An array of Regexp to validate
561
551
  # whether inheriting /including a sealed module outside the defining module
@@ -12,7 +12,7 @@
12
12
  # modules that override the `hash` method with something completely broken.
13
13
  module T::Private::Abstract::Data
14
14
  def self.get(mod, key)
15
- mod.instance_variable_get("@opus_abstract__#{key}") if key?(mod, key)
15
+ mod.instance_variable_get("@opus_abstract__#{key}")
16
16
  end
17
17
 
18
18
  def self.set(mod, key, value)
@@ -70,7 +70,7 @@ module T::Private::Sealed
70
70
 
71
71
  def self.validate_inheritance(caller_loc, parent, child, verb)
72
72
  this_file = caller_loc&.path
73
- decl_file = parent.instance_variable_get(:@sorbet_sealed_module_decl_file) if sealed_module?(parent)
73
+ decl_file = parent.instance_variable_get(:@sorbet_sealed_module_decl_file)
74
74
 
75
75
  if !this_file
76
76
  raise "Could not use backtrace to determine file for #{verb} child #{child}"
@@ -174,7 +174,9 @@ class T::Props::Decorator
174
174
  .checked(:never)
175
175
  end
176
176
  def prop_get(instance, prop, rules=prop_rules(prop))
177
- val = instance.instance_variable_get(rules[:accessor_key]) if instance.instance_variable_defined?(rules[:accessor_key])
177
+ # `instance_variable_get` will return nil if the variable doesn't exist
178
+ # which is what we want to have happen for the logic below.
179
+ val = instance.instance_variable_get(rules[:accessor_key])
178
180
  if !val.nil?
179
181
  val
180
182
  elsif (d = rules[:ifunset])
@@ -194,7 +196,9 @@ class T::Props::Decorator
194
196
  .checked(:never)
195
197
  end
196
198
  def prop_get_if_set(instance, prop, rules=prop_rules(prop))
197
- instance.instance_variable_get(rules[:accessor_key]) if instance.instance_variable_defined?(rules[:accessor_key])
199
+ # `instance_variable_get` will return nil if the variable doesn't exist
200
+ # which is what we want to have happen for the return value here.
201
+ instance.instance_variable_get(rules[:accessor_key])
198
202
  end
199
203
  alias_method :get, :prop_get_if_set # Alias for backwards compatibility
200
204
 
@@ -37,7 +37,7 @@ module T::Props
37
37
 
38
38
  sig { returns(T::Boolean) }
39
39
  def self.lazy_evaluation_enabled?
40
- !defined?(@lazy_evaluation_disabled) || !@lazy_evaluation_disabled
40
+ !@lazy_evaluation_disabled
41
41
  end
42
42
 
43
43
  module DecoratorMethods
@@ -121,8 +121,8 @@ module T::Props::Serializable
121
121
  private def with_existing_hash(changed_props, existing_hash:)
122
122
  serialized = existing_hash
123
123
  new_val = self.class.from_hash(serialized.merge(recursive_stringify_keys(changed_props)))
124
- old_extra = self.instance_variable_get(:@_extra_props) if self.instance_variable_defined?(:@_extra_props)
125
- new_extra = new_val.instance_variable_get(:@_extra_props) if new_val.instance_variable_defined?(:@_extra_props)
124
+ old_extra = self.instance_variable_get(:@_extra_props)
125
+ new_extra = new_val.instance_variable_get(:@_extra_props)
126
126
  if old_extra != new_extra
127
127
  difference =
128
128
  if old_extra
@@ -137,8 +137,7 @@ module T::Props::Serializable
137
137
 
138
138
  # Asserts if this property is missing during strict serialize
139
139
  private def required_prop_missing_from_serialize(prop)
140
- if defined?(@_required_props_missing_from_deserialize) &&
141
- @_required_props_missing_from_deserialize&.include?(prop)
140
+ if @_required_props_missing_from_deserialize&.include?(prop)
142
141
  # If the prop was already missing during deserialization, that means the application
143
142
  # code already had to deal with a nil value, which means we wouldn't be accomplishing
144
143
  # much by raising here (other than causing an unnecessary breakage).
@@ -353,11 +352,7 @@ module T::Props::Serializable::DecoratorMethods
353
352
  private_constant :EMPTY_EXTRA_PROPS
354
353
 
355
354
  def extra_props(instance)
356
- if instance.instance_variable_defined?(:@_extra_props)
357
- instance.instance_variable_get(:@_extra_props) || EMPTY_EXTRA_PROPS
358
- else
359
- EMPTY_EXTRA_PROPS
360
- end
355
+ instance.instance_variable_get(:@_extra_props) || EMPTY_EXTRA_PROPS
361
356
  end
362
357
 
363
358
  # adds to the default result of T::Props::PrettyPrintable
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.12534
4
+ version: 0.6.12549
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-16 00:00:00.000000000 Z
11
+ date: 2025-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest