Web Inspector: ObjC RWIProtocol codegen should better handle optional members
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Apr 2017 22:02:06 +0000 (22:02 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Apr 2017 22:02:06 +0000 (22:02 +0000)
commit1f1caeb031218004c21f82a4fc50d007f7fba1c9
treeefac622005a665b281fca6680c1c5a180a084c26
parent9b4a5827a2fd7215cf36f25bfe3a68bcce33ac12
Web Inspector: ObjC RWIProtocol codegen should better handle optional members
https://bugs.webkit.org/show_bug.cgi?id=171251
<rdar://problem/31697002>

Reviewed by Brian Burg.

* inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:
(ObjCProtocolTypesImplementationGenerator._generate_getter_for_member):
* inspector/scripts/codegen/objc_generator.py:
(ObjCGenerator.protocol_to_objc_expression_for_member):
(ObjCGenerator.protocol_to_objc_code_block_for_object_member):
Always be safe and nil check object property accesses, optional or not.

* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
Rebaselined inspector generator tests.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/objc_generator.py
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result