Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Side by Side Diff: Source/bindings/scripts/v8_methods.py

Issue 568703002: IDL: Values for dictionaries should be a object, null or undefined (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 idl_type.is_wrapper_type, 246 idl_type.is_wrapper_type,
247 'has_type_checking_unrestricted': 247 'has_type_checking_unrestricted':
248 (has_extended_attribute_value(interface, 'TypeChecking', 'Unrestrict ed') or 248 (has_extended_attribute_value(interface, 'TypeChecking', 'Unrestrict ed') or
249 has_extended_attribute_value(method, 'TypeChecking', 'Unrestricted' )) and 249 has_extended_attribute_value(method, 'TypeChecking', 'Unrestricted' )) and
250 idl_type.name in ('Float', 'Double'), 250 idl_type.name in ('Float', 'Double'),
251 # Dictionary is special-cased, but arrays and sequences shouldn't be 251 # Dictionary is special-cased, but arrays and sequences shouldn't be
252 'idl_type': idl_type.base_type, 252 'idl_type': idl_type.base_type,
253 'idl_type_object': idl_type, 253 'idl_type_object': idl_type,
254 'index': index, 254 'index': index,
255 'is_callback_interface': idl_type.is_callback_interface, 255 'is_callback_interface': idl_type.is_callback_interface,
256 # FIXME: Remove generic 'Dictionary' special-casing
257 'is_dictionary': idl_type.is_dictionary or idl_type.base_type == 'Dictio nary',
256 'is_nullable': idl_type.is_nullable, 258 'is_nullable': idl_type.is_nullable,
257 'is_optional': argument.is_optional, 259 'is_optional': argument.is_optional,
258 'is_variadic_wrapper_type': is_variadic_wrapper_type, 260 'is_variadic_wrapper_type': is_variadic_wrapper_type,
259 'is_wrapper_type': idl_type.is_wrapper_type, 261 'is_wrapper_type': idl_type.is_wrapper_type,
260 'name': argument.name, 262 'name': argument.name,
261 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( 263 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
262 argument.name, isolate='scriptState->isolate()', 264 argument.name, isolate='scriptState->isolate()',
263 creation_context='scriptState->context()->Global()'), 265 creation_context='scriptState->context()->Global()'),
264 'v8_set_return_value': v8_set_return_value(interface.name, method, this_ cpp_value), 266 'v8_set_return_value': v8_set_return_value(interface.name, method, this_ cpp_value),
265 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name , method, this_cpp_value, for_main_world=True), 267 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name , method, this_cpp_value, for_main_world=True),
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 if argument.idl_type.is_dictionary: 458 if argument.idl_type.is_dictionary:
457 # We always create impl objects for IDL dictionaries. 459 # We always create impl objects for IDL dictionaries.
458 return '%s::create()' % argument.idl_type.base_type 460 return '%s::create()' % argument.idl_type.base_type
459 if not argument.default_value: 461 if not argument.default_value:
460 return None 462 return None
461 return argument.idl_type.literal_cpp_value(argument.default_value) 463 return argument.idl_type.literal_cpp_value(argument.default_value)
462 464
463 IdlTypeBase.union_arguments = None 465 IdlTypeBase.union_arguments = None
464 IdlUnionType.union_arguments = property(union_arguments) 466 IdlUnionType.union_arguments = property(union_arguments)
465 IdlArgument.default_cpp_value = property(argument_default_cpp_value) 467 IdlArgument.default_cpp_value = property(argument_default_cpp_value)
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt ('k') | Source/bindings/templates/dictionary_v8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698