| OLD | NEW |
| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 'unsigned long', | 73 'unsigned long', |
| 74 'long long', | 74 'long long', |
| 75 'unsigned long long', | 75 'unsigned long long', |
| 76 # Blink-specific additions | 76 # Blink-specific additions |
| 77 'Date', | 77 'Date', |
| 78 'void', | 78 'void', |
| 79 ]) | 79 ]) |
| 80 CPP_VALUE_TO_V8_VALUE_DICT = { | 80 CPP_VALUE_TO_V8_VALUE_DICT = { |
| 81 'boolean': 'v8Boolean({cpp_value}, {isolate})', | 81 'boolean': 'v8Boolean({cpp_value}, {isolate})', |
| 82 # long long and unsigned long long are not representable in ECMAScript. | 82 # long long and unsigned long long are not representable in ECMAScript. |
| 83 'long long': 'v8::Number::New(static_cast<double>({cpp_value}))', | 83 'long long': 'v8::Number::New({isolate}, static_cast<double>({cpp_value}))', |
| 84 'unsigned long long': 'v8::Number::New(static_cast<double>({cpp_value}))', | 84 'unsigned long long': 'v8::Number::New({isolate}, static_cast<double>({cpp_v
alue}))', |
| 85 'float': 'v8::Number::New({cpp_value})', | 85 'float': 'v8::Number::New({isolate}, {cpp_value})', |
| 86 'double': 'v8::Number::New({cpp_value})', | 86 'double': 'v8::Number::New({isolate}, {cpp_value})', |
| 87 'DOMTimeStamp': 'v8::Number::New(static_cast<double>({cpp_value}))', | 87 'DOMTimeStamp': 'v8::Number::New({isolate}, static_cast<double>({cpp_value})
)', |
| 88 'DOMString': 'v8String({cpp_value}, {isolate})', | 88 'DOMString': 'v8String({cpp_value}, {isolate})', |
| 89 } | 89 } |
| 90 CPP_VALUE_TO_V8_VALUE_ARRAY_OR_SEQUENCE_TYPE = 'v8Array({cpp_value}, {isolate})' | 90 CPP_VALUE_TO_V8_VALUE_ARRAY_OR_SEQUENCE_TYPE = 'v8Array({cpp_value}, {isolate})' |
| 91 CPP_VALUE_TO_V8_VALUE_DEFAULT = 'toV8({cpp_value}, {creation_context}, {isolate}
)' | 91 CPP_VALUE_TO_V8_VALUE_DEFAULT = 'toV8({cpp_value}, {creation_context}, {isolate}
)' |
| 92 V8_SET_RETURN_VALUE_DICT = { | 92 V8_SET_RETURN_VALUE_DICT = { |
| 93 'unsigned': 'v8SetReturnValueUnsigned({callback_info}, {cpp_value});', | 93 'unsigned': 'v8SetReturnValueUnsigned({callback_info}, {cpp_value});', |
| 94 } | 94 } |
| 95 | 95 |
| 96 | 96 |
| 97 def array_or_sequence_type(idl_type): | 97 def array_or_sequence_type(idl_type): |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 def includes_for_type(idl_type): | 169 def includes_for_type(idl_type): |
| 170 if primitive_type(idl_type) or idl_type == 'DOMString': | 170 if primitive_type(idl_type) or idl_type == 'DOMString': |
| 171 return set() | 171 return set() |
| 172 if idl_type == 'Promise': | 172 if idl_type == 'Promise': |
| 173 return set(['ScriptPromise.h']) | 173 return set(['ScriptPromise.h']) |
| 174 this_array_or_sequence_type = array_or_sequence_type(idl_type) | 174 this_array_or_sequence_type = array_or_sequence_type(idl_type) |
| 175 if this_array_or_sequence_type: | 175 if this_array_or_sequence_type: |
| 176 return includes_for_type(this_array_or_sequence_type) | 176 return includes_for_type(this_array_or_sequence_type) |
| 177 return set(['V8%s.h' % idl_type]) | 177 return set(['V8%s.h' % idl_type]) |
| OLD | NEW |