OLD | NEW |
---|---|
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> | 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> |
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> | 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> |
5 # Copyright (C) 2006 Apple Computer, Inc. | 5 # Copyright (C) 2006 Apple Computer, Inc. |
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. | 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. |
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. | 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. |
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. | 10 # Copyright (C) 2012 Ericsson AB. All rights reserved. |
(...skipping 4031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4042 my $raisesExceptions = $indexedDeleterFunction->extendedAttributes->{"Raises Exception"}; | 4042 my $raisesExceptions = $indexedDeleterFunction->extendedAttributes->{"Raises Exception"}; |
4043 | 4043 |
4044 my $code = "static void indexedPropertyDeleter(unsigned index, const v8::Pro pertyCallbackInfo<v8::Boolean>& info)\n"; | 4044 my $code = "static void indexedPropertyDeleter(unsigned index, const v8::Pro pertyCallbackInfo<v8::Boolean>& info)\n"; |
4045 $code .= "{\n"; | 4045 $code .= "{\n"; |
4046 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n"; | 4046 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n"; |
4047 my $extraArguments = ""; | 4047 my $extraArguments = ""; |
4048 if ($raisesExceptions) { | 4048 if ($raisesExceptions) { |
4049 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n"; | 4049 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n"; |
4050 $extraArguments = ", exceptionState"; | 4050 $extraArguments = ", exceptionState"; |
4051 } | 4051 } |
4052 $code .= " bool result = collection->${methodName}(index$extraArguments); \n"; | 4052 $code .= " DeleteResult result = collection->${methodName}(index$extraArg uments);\n"; |
4053 if ($raisesExceptions) { | 4053 if ($raisesExceptions) { |
4054 $code .= " if (exceptionState.throwIfNeeded())\n"; | 4054 $code .= " if (exceptionState.throwIfNeeded())\n"; |
4055 $code .= " return;\n"; | 4055 $code .= " return;\n"; |
4056 } | 4056 } |
4057 $code .= " return v8SetReturnValueBool(info, result);\n"; | 4057 $code .= " if (result != DeleteUnknownProperty)\n"; |
4058 $code .= " return v8SetReturnValueBool(info, result == DeleteSuccess) ;\n"; | |
4058 $code .= "}\n\n"; | 4059 $code .= "}\n\n"; |
4059 $implementation{nameSpaceInternal}->add($code); | 4060 $implementation{nameSpaceInternal}->add($code); |
4060 } | 4061 } |
4061 | 4062 |
4062 sub GenerateImplementationNamedPropertyDeleter | 4063 sub GenerateImplementationNamedPropertyDeleter |
4063 { | 4064 { |
4064 my $interface = shift; | 4065 my $interface = shift; |
4065 my $namedDeleterFunction = shift; | 4066 my $namedDeleterFunction = shift; |
4066 my $implClassName = GetImplName($interface); | 4067 my $implClassName = GetImplName($interface); |
4067 my $v8ClassName = GetV8ClassName($interface); | 4068 my $v8ClassName = GetV8ClassName($interface); |
4068 my $methodName = GetImplName($namedDeleterFunction); | 4069 my $methodName = GetImplName($namedDeleterFunction); |
4069 | 4070 |
4070 my $raisesExceptions = $namedDeleterFunction->extendedAttributes->{"RaisesEx ception"}; | 4071 my $raisesExceptions = $namedDeleterFunction->extendedAttributes->{"RaisesEx ception"}; |
4071 | 4072 |
4072 my $code = "static void namedPropertyDeleter(v8::Local<v8::String> name, con st v8::PropertyCallbackInfo<v8::Boolean>& info)\n"; | 4073 my $code = "static void namedPropertyDeleter(v8::Local<v8::String> name, con st v8::PropertyCallbackInfo<v8::Boolean>& info)\n"; |
4073 $code .= "{\n"; | 4074 $code .= "{\n"; |
4074 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n"; | 4075 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n"; |
4075 $code .= " AtomicString propertyName = toCoreAtomicString(name);\n"; | 4076 $code .= " AtomicString propertyName = toCoreAtomicString(name);\n"; |
4076 my $extraArguments = ""; | 4077 my $extraArguments = ""; |
4077 if ($raisesExceptions) { | 4078 if ($raisesExceptions) { |
4078 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n"; | 4079 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n"; |
4079 $extraArguments = ", exceptionState"; | 4080 $extraArguments .= ", exceptionState"; |
4080 } | 4081 } |
4081 $code .= " bool result = collection->${methodName}(propertyName$extraArgu ments);\n"; | 4082 $code .= " DeleteResult result = collection->${methodName}(propertyName$e xtraArguments);\n"; |
4082 if ($raisesExceptions) { | 4083 if ($raisesExceptions) { |
4083 $code .= " if (exceptionState.throwIfNeeded())\n"; | 4084 $code .= " if (exceptionState.throwIfNeeded())\n"; |
4084 $code .= " return;\n"; | 4085 $code .= " return;\n"; |
4085 } | 4086 } |
4086 $code .= " return v8SetReturnValueBool(info, result);\n"; | 4087 $code .= " if (result != DeleteUnknownProperty)\n"; |
4088 $code .= " return v8SetReturnValueBool(info, result == DeleteSuccess) ;\n"; | |
jsbell
2013/12/18 00:49:34
Sorry if I'm missing something, but doesn't this i
sof
2013/12/18 06:17:00
Yes, exactly that.
The v8 interceptor code that's
| |
4087 $code .= "}\n\n"; | 4089 $code .= "}\n\n"; |
4088 $implementation{nameSpaceInternal}->add($code); | 4090 $implementation{nameSpaceInternal}->add($code); |
4089 } | 4091 } |
4090 | 4092 |
4091 sub GenerateImplementationNamedPropertyEnumerator | 4093 sub GenerateImplementationNamedPropertyEnumerator |
4092 { | 4094 { |
4093 my $interface = shift; | 4095 my $interface = shift; |
4094 my $implClassName = GetImplName($interface); | 4096 my $implClassName = GetImplName($interface); |
4095 my $v8ClassName = GetV8ClassName($interface); | 4097 my $v8ClassName = GetV8ClassName($interface); |
4096 | 4098 |
(...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6337 | 6339 |
6338 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "ToV8"); | 6340 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "ToV8"); |
6339 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "Wrap"); | 6341 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "Wrap"); |
6340 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; | 6342 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; |
6341 return 1 if InheritsInterface($interface, "Document"); | 6343 return 1 if InheritsInterface($interface, "Document"); |
6342 | 6344 |
6343 return 0; | 6345 return 0; |
6344 } | 6346 } |
6345 | 6347 |
6346 1; | 6348 1; |
OLD | NEW |