-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[webview_flutter_wkwebview] Return an NSNumber that represents a bool #5968
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,8 @@ - (void)testRemoveDataOfTypes { | |
blockError = error; | ||
}]; | ||
XCTAssertEqualObjects(returnValue, @YES); | ||
// Asserts whether the NSNumber value represents a BOOL. | ||
XCTAssertEqual(CFBooleanGetTypeID(), CFGetTypeID((__bridge CFTypeRef)(returnValue))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Compare to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, this is essentially code taken from https://github.com/flutter/engine/blob/main/shell/platform/darwin/common/framework/Source/FlutterStandardCodec.mm#L278. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I just wasn't reading carefully and thought the right hand side was the expected value and that you were extracting the type from a local variable. I was suggesting using (It is confusing that this test is inconsistent about whether you put the expected value first or second though. The line right above this does the opposite.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, you're right. I switched the order |
||
XCTAssertNil(blockError); | ||
} | ||
@end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ - (void)createDefaultDataStoreWithIdentifier:(nonnull NSNumber *)identifier | |
modifiedSince:[NSDate dateWithTimeIntervalSince1970: | ||
modificationTimeInSecondsSinceEpoch.doubleValue] | ||
completionHandler:^{ | ||
completion(@(records.count > 0), nil); | ||
completion([NSNumber numberWithBool:(records.count > 0)], nil); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, that's a surprising foot-gun. TIL. What type was it turning into exactly? Int? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, it was returning an int for some reason. |
||
}]; | ||
}]; | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.