Skip to content

Commit df7032d

Browse files
Unreviewed, rolling out r235432 and r235436.
https://bugs.webkit.org/show_bug.cgi?id=189086 Is a Swift source breaking change. (Requested by keith_miller on #webkit). Reverted changesets: "Add nullablity attributes to JSValue" https://bugs.webkit.org/show_bug.cgi?id=189047 https://trac.webkit.org/changeset/235432 "Add nullablity attributes to JSValue" https://bugs.webkit.org/show_bug.cgi?id=189047 https://trac.webkit.org/changeset/235436 Canonical link: https://commits.webkit.org/204118@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent fdffe4c commit df7032d

2 files changed

Lines changed: 39 additions & 25 deletions

File tree

‎Source/JavaScriptCore/API/JSValue.h‎

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
#import <CoreGraphics/CGGeometry.h>
3232

33-
NS_ASSUME_NONNULL_BEGIN
34-
3533
@class JSContext;
3634

3735
/*!
@@ -50,9 +48,9 @@ NS_CLASS_AVAILABLE(10_9, 7_0)
5048
@interface JSValue : NSObject
5149

5250
#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < JSC_MAC_VERSION_TBA) || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < JSC_IOS_VERSION_TBA)
53-
typedef NSString * JSValueProperty;
51+
typedef NSString *JSValueProperty;
5452
#else
55-
typedef id _Nullable JSValueProperty;
53+
typedef id JSValueProperty;
5654
#endif
5755

5856
/*!
@@ -71,7 +69,7 @@ typedef id _Nullable JSValueProperty;
7169
@param value The Objective-C object to be converted.
7270
@result The new JSValue.
7371
*/
74-
+ (JSValue *)valueWithObject:(nullable id)value inContext:(JSContext *)context;
72+
+ (JSValue *)valueWithObject:(id)value inContext:(JSContext *)context;
7573

7674
/*!
7775
@method
@@ -218,7 +216,7 @@ typedef id _Nullable JSValueProperty;
218216
to the conversion rules specified above.
219217
@result The Objective-C representation of this JSValue.
220218
*/
221-
- (nullable id)toObject;
219+
- (id)toObject;
222220

223221
/*!
224222
@method
@@ -227,7 +225,7 @@ typedef id _Nullable JSValueProperty;
227225
If the result is not of the specified Class then <code>nil</code> will be returned.
228226
@result An Objective-C object of the specified Class or <code>nil</code>.
229227
*/
230-
- (nullable id)toObjectOfClass:(Class)expectedClass;
228+
- (id)toObjectOfClass:(Class)expectedClass;
231229

232230
/*!
233231
@method
@@ -273,7 +271,7 @@ typedef id _Nullable JSValueProperty;
273271
to the rules specified by the JavaScript language.
274272
@result The NSNumber result of the conversion.
275273
*/
276-
- (nullable NSNumber *)toNumber;
274+
- (NSNumber *)toNumber;
277275

278276
/*!
279277
@method
@@ -282,7 +280,7 @@ typedef id _Nullable JSValueProperty;
282280
by the JavaScript language.
283281
@result The NSString containing the result of the conversion.
284282
*/
285-
- (nullable NSString *)toString;
283+
- (NSString *)toString;
286284

287285
/*!
288286
@method
@@ -291,7 +289,7 @@ typedef id _Nullable JSValueProperty;
291289
since 1970 which is then used to create a new NSDate instance.
292290
@result The NSDate created using the converted time interval.
293291
*/
294-
- (nullable NSDate *)toDate;
292+
- (NSDate *)toDate;
295293

296294
/*!
297295
@method
@@ -305,7 +303,7 @@ typedef id _Nullable JSValueProperty;
305303
@result The NSArray containing the recursively converted contents of the
306304
converted JavaScript array.
307305
*/
308-
- (nullable NSArray *)toArray;
306+
- (NSArray *)toArray;
309307

310308
/*!
311309
@method
@@ -317,7 +315,7 @@ typedef id _Nullable JSValueProperty;
317315
@result The NSDictionary containing the recursively converted contents of
318316
the converted JavaScript object.
319317
*/
320-
- (nullable NSDictionary *)toDictionary;
318+
- (NSDictionary *)toDictionary;
321319

322320
/*!
323321
@methodgroup Accessing Properties
@@ -337,7 +335,7 @@ typedef id _Nullable JSValueProperty;
337335
@abstract Set a property on a JSValue.
338336
@discussion Corresponds to the JavaScript operation <code>object[property] = value</code>. After macOS TBA and iOS TBA, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS TBA and iOS TBA, 'property' was expected to be an NSString *.
339337
*/
340-
- (void)setValue:(nullable id)value forProperty:(JSValueProperty)property;
338+
- (void)setValue:(id)value forProperty:(JSValueProperty)property;
341339

342340
/*!
343341
@method
@@ -362,7 +360,7 @@ typedef id _Nullable JSValueProperty;
362360
@discussion This method may be used to create a data or accessor property on an object.
363361
This method operates in accordance with the Object.defineProperty method in the JavaScript language. After macOS TBA and iOS TBA, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS TBA and iOS TBA, 'property' was expected to be an NSString *.
364362
*/
365-
- (void)defineProperty:(JSValueProperty)property descriptor:(nullable id)descriptor;
363+
- (void)defineProperty:(JSValueProperty)property descriptor:(id)descriptor;
366364

367365
/*!
368366
@method
@@ -378,7 +376,7 @@ typedef id _Nullable JSValueProperty;
378376
@discussion For JSValues that are JavaScript arrays, indices greater than
379377
UINT_MAX - 1 will not affect the length of the array.
380378
*/
381-
- (void)setValue:(nullable id)value atIndex:(NSUInteger)index;
379+
- (void)setValue:(id)value atIndex:(NSUInteger)index;
382380

383381
/*!
384382
@functiongroup Checking JavaScript Types
@@ -445,13 +443,13 @@ typedef id _Nullable JSValueProperty;
445443
@method
446444
@abstract Compare two JSValues using JavaScript's <code>===</code> operator.
447445
*/
448-
- (BOOL)isEqualToObject:(nullable id)value;
446+
- (BOOL)isEqualToObject:(id)value;
449447

450448
/*!
451449
@method
452450
@abstract Compare two JSValues using JavaScript's <code>==</code> operator.
453451
*/
454-
- (BOOL)isEqualWithTypeCoercionToObject:(nullable id)value;
452+
- (BOOL)isEqualWithTypeCoercionToObject:(id)value;
455453

456454
/*!
457455
@method
@@ -460,7 +458,7 @@ typedef id _Nullable JSValueProperty;
460458
If an object other than a JSValue is passed, it will first be converted according to
461459
the aforementioned rules.
462460
*/
463-
- (BOOL)isInstanceOf:(nullable id)value;
461+
- (BOOL)isInstanceOf:(id)value;
464462

465463
/*!
466464
@methodgroup Calling Functions and Constructors
@@ -473,7 +471,7 @@ typedef id _Nullable JSValueProperty;
473471
@param arguments The arguments to pass to the function.
474472
@result The return value of the function call.
475473
*/
476-
- (JSValue *)callWithArguments:(nullable NSArray *)arguments;
474+
- (JSValue *)callWithArguments:(NSArray *)arguments;
477475

478476
/*!
479477
@method
@@ -482,7 +480,7 @@ typedef id _Nullable JSValueProperty;
482480
@param arguments The arguments to pass to the constructor.
483481
@result The return value of the constructor call.
484482
*/
485-
- (JSValue *)constructWithArguments:(nullable NSArray *)arguments;
483+
- (JSValue *)constructWithArguments:(NSArray *)arguments;
486484

487485
/*!
488486
@method
@@ -494,7 +492,7 @@ typedef id _Nullable JSValueProperty;
494492
@param arguments The arguments to pass to the method.
495493
@result The return value of the method call.
496494
*/
497-
- (JSValue *)invokeMethod:(NSString *)method withArguments:(nullable NSArray *)arguments;
495+
- (JSValue *)invokeMethod:(NSString *)method withArguments:(NSArray *)arguments;
498496

499497
@end
500498

@@ -605,8 +603,8 @@ Create a JSValue from a CGRect.
605603

606604
- (JSValue *)objectForKeyedSubscript:(JSValueProperty)key;
607605
- (JSValue *)objectAtIndexedSubscript:(NSUInteger)index;
608-
- (void)setObject:(nullable id)object forKeyedSubscript:(JSValueProperty)key;
609-
- (void)setObject:(nullable id)object atIndexedSubscript:(NSUInteger)index;
606+
- (void)setObject:(id)object forKeyedSubscript:(JSValueProperty)key;
607+
- (void)setObject:(id)object atIndexedSubscript:(NSUInteger)index;
610608

611609
@end
612610

@@ -693,8 +691,6 @@ JS_EXPORT extern NSString * const JSPropertyDescriptorSetKey;
693691
} // extern "C"
694692
#endif
695693

696-
NS_ASSUME_NONNULL_END
697-
698694
#endif
699695

700696
#endif // JSValue_h

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2018-08-29 Commit Queue <commit-queue@webkit.org>
2+
3+
Unreviewed, rolling out r235432 and r235436.
4+
https://bugs.webkit.org/show_bug.cgi?id=189086
5+
6+
Is a Swift source breaking change. (Requested by keith_miller
7+
on #webkit).
8+
9+
Reverted changesets:
10+
11+
"Add nullablity attributes to JSValue"
12+
https://bugs.webkit.org/show_bug.cgi?id=189047
13+
https://trac.webkit.org/changeset/235432
14+
15+
"Add nullablity attributes to JSValue"
16+
https://bugs.webkit.org/show_bug.cgi?id=189047
17+
https://trac.webkit.org/changeset/235436
18+
119
2018-08-28 Mark Lam <mark.lam@apple.com>
220

321
Fix bit-rotted Interpreter::dumpRegisters() and move it to the VMInspector.

0 commit comments

Comments
 (0)