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

Unified Diff: Source/bindings/scripts/code_generator_v8.pm

Issue 158663002: IDL compiler: sync Python to r166688 (and clean up special operations+union code) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Typo Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/bindings/scripts/unstable/v8_interface.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/code_generator_v8.pm
diff --git a/Source/bindings/scripts/code_generator_v8.pm b/Source/bindings/scripts/code_generator_v8.pm
index fb10155476c5611f30f9ec5469e76876d8495e80..a6e14016264dbe3c5e35864633853f30c9ab96e6 100644
--- a/Source/bindings/scripts/code_generator_v8.pm
+++ b/Source/bindings/scripts/code_generator_v8.pm
@@ -3704,15 +3704,15 @@ sub GenerateImplementationIndexedPropertyGetter
my $returnType = $indexedGetterFunction->type;
my $nativeType = GetNativeType($returnType);
- my $nativeValue = "element";
+ my $nativeValue = "result";
$nativeValue .= ".release()" if (IsRefPtrType($returnType));
- my $isNull = GenerateIsNullExpression($returnType, "element");
- my $returnJSValueCode = NativeToJSValue($indexedGetterFunction->type, $indexedGetterFunction->extendedAttributes, $nativeValue, " ", "", "info.GetIsolate()", "info", "collection", "", "return");
+ my $isNull = GenerateIsNullExpression($returnType, "result");
+ my $returnJSValueCode = NativeToJSValue($indexedGetterFunction->type, $indexedGetterFunction->extendedAttributes, $nativeValue, " ", "", "info.GetIsolate()", "info", "imp", "", "return");
my $raisesExceptions = $indexedGetterFunction->extendedAttributes->{"RaisesException"};
- my $methodCallCode = GenerateMethodCall($returnType, "element", "collection->${methodName}", "index", $raisesExceptions);
+ my $methodCallCode = GenerateMethodCall($returnType, "result", "imp->${methodName}", "index", $raisesExceptions);
my $getterCode = "static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)\n";
$getterCode .= "{\n";
- $getterCode .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.Holder());\n";
+ $getterCode .= " ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());\n";
if ($raisesExceptions) {
$getterCode .= " ExceptionState exceptionState(info.Holder(), info.GetIsolate());\n";
}
@@ -3811,7 +3811,7 @@ sub GenerateImplementationIndexedPropertySetter
$code .= "{\n";
my $asSetterValue = 0;
- $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.Holder());\n";
+ $code .= " ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());\n";
$code .= JSValueToNativeStatement($indexedSetterFunction->parameters->[1]->type, $indexedSetterFunction->extendedAttributes, $asSetterValue, "jsValue", "propertyValue", " ", "info.GetIsolate()");
my $extraArguments = "";
@@ -3832,7 +3832,7 @@ sub GenerateImplementationIndexedPropertySetter
END
}
- $code .= " bool result = collection->${methodName}(index, propertyValue$extraArguments);\n";
+ $code .= " bool result = imp->${methodName}(index, propertyValue$extraArguments);\n";
if ($raisesExceptions) {
$code .= " if (exceptionState.throwIfNeeded())\n";
@@ -4058,7 +4058,7 @@ sub GenerateMethodCall
return $code;
} else {
my $nativeType = GetNativeType($returnType);
- return " ${nativeType} element = ${functionExpression}(" . (join ", ", @arguments) . ");"
+ return " ${nativeType} result = ${functionExpression}(" . (join ", ", @arguments) . ");"
}
}
@@ -4071,12 +4071,12 @@ sub GenerateImplementationNamedPropertyGetter
my $methodName = GetImplName($namedGetterFunction) || "anonymousNamedGetter";
my $returnType = $namedGetterFunction->type;
- my $isNull = GenerateIsNullExpression($returnType, "element");
- my $nativeValue = "element";
+ my $isNull = GenerateIsNullExpression($returnType, "result");
+ my $nativeValue = "result";
$nativeValue .= ".release()" if (IsRefPtrType($returnType));
- my $returnJSValueCode = NativeToJSValue($namedGetterFunction->type, $namedGetterFunction->extendedAttributes, $nativeValue, " ", "", "info.GetIsolate()", "info", "collection", "", "return");
+ my $returnJSValueCode = NativeToJSValue($namedGetterFunction->type, $namedGetterFunction->extendedAttributes, $nativeValue, " ", "", "info.GetIsolate()", "info", "imp", "", "return");
my $raisesExceptions = $namedGetterFunction->extendedAttributes->{"RaisesException"};
- my $methodCallCode = GenerateMethodCall($returnType, "element", "collection->${methodName}", "propertyName", $raisesExceptions);
+ my $methodCallCode = GenerateMethodCall($returnType, "result", "imp->${methodName}", "propertyName", $raisesExceptions);
my $code = "static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)\n";
$code .= "{\n";
@@ -4089,7 +4089,7 @@ sub GenerateImplementationNamedPropertyGetter
$code .= " return;\n";
$code .= "\n";
}
- $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.Holder());\n";
+ $code .= " ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());\n";
$code .= " AtomicString propertyName = toCoreAtomicString(name);\n";
if ($raisesExceptions) {
$code .= " ExceptionState exceptionState(info.Holder(), info.GetIsolate());\n";
@@ -4133,7 +4133,7 @@ sub GenerateImplementationNamedPropertySetter
}
my $asSetterValue = 0;
- $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.Holder());\n";
+ $code .= " ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());\n";
$code .= JSValueToNativeStatement($namedSetterFunction->parameters->[0]->type, $namedSetterFunction->extendedAttributes, $asSetterValue, "name", "propertyName", " ", "info.GetIsolate()");
$code .= JSValueToNativeStatement($namedSetterFunction->parameters->[1]->type, $namedSetterFunction->extendedAttributes, $asSetterValue, "jsValue", "propertyValue", " ", "info.GetIsolate()");
@@ -4145,7 +4145,7 @@ sub GenerateImplementationNamedPropertySetter
}
}
- $code .= " bool result = collection->$methodName(propertyName, propertyValue$extraArguments);\n";
+ $code .= " bool result = imp->$methodName(propertyName, propertyValue$extraArguments);\n";
if ($raisesExceptions) {
$code .= " if (exceptionState.throwIfNeeded())\n";
$code .= " return;\n";
@@ -4169,13 +4169,13 @@ sub GenerateImplementationIndexedPropertyDeleter
my $code = "static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)\n";
$code .= "{\n";
- $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.Holder());\n";
+ $code .= " ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());\n";
my $extraArguments = "";
if ($raisesExceptions) {
$code .= " ExceptionState exceptionState(info.Holder(), info.GetIsolate());\n";
$extraArguments = ", exceptionState";
}
- $code .= " DeleteResult result = collection->${methodName}(index$extraArguments);\n";
+ $code .= " DeleteResult result = imp->${methodName}(index$extraArguments);\n";
if ($raisesExceptions) {
$code .= " if (exceptionState.throwIfNeeded())\n";
$code .= " return;\n";
@@ -4198,14 +4198,14 @@ sub GenerateImplementationNamedPropertyDeleter
my $code = "static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)\n";
$code .= "{\n";
- $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.Holder());\n";
+ $code .= " ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());\n";
$code .= " AtomicString propertyName = toCoreAtomicString(name);\n";
my $extraArguments = "";
if ($raisesExceptions) {
$code .= " ExceptionState exceptionState(info.Holder(), info.GetIsolate());\n";
$extraArguments .= ", exceptionState";
}
- $code .= " DeleteResult result = collection->${methodName}(propertyName$extraArguments);\n";
+ $code .= " DeleteResult result = imp->${methodName}(propertyName$extraArguments);\n";
if ($raisesExceptions) {
$code .= " if (exceptionState.throwIfNeeded())\n";
$code .= " return;\n";
@@ -4225,10 +4225,10 @@ sub GenerateImplementationNamedPropertyEnumerator
$implementation{nameSpaceInternal}->add(<<END);
static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
{
- ${implClassName}* collection = ${v8ClassName}::toNative(info.Holder());
+ ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());
Vector<String> names;
ExceptionState exceptionState(info.Holder(), info.GetIsolate());
- collection->namedPropertyEnumerator(names, exceptionState);
+ imp->namedPropertyEnumerator(names, exceptionState);
if (exceptionState.throwIfNeeded())
return;
v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size());
@@ -4249,10 +4249,10 @@ sub GenerateImplementationNamedPropertyQuery
$implementation{nameSpaceInternal}->add(<<END);
static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
{
- ${implClassName}* collection = ${v8ClassName}::toNative(info.Holder());
+ ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
ExceptionState exceptionState(info.Holder(), info.GetIsolate());
- bool result = collection->namedPropertyQuery(propertyName, exceptionState);
+ bool result = imp->namedPropertyQuery(propertyName, exceptionState);
if (exceptionState.throwIfNeeded())
return;
if (!result)
@@ -5734,7 +5734,7 @@ sub NativeToJSValue
$code .= "${indent}if (${unionMemberEnabledVariable}) {\n";
$code .= "${returnJSValueCode}\n";
$code .= "${indent} return;\n";
- $code .= "${indent}}\n";
+ $code .= "${indent}}";
} else {
$code .= "${indent}if (${unionMemberEnabledVariable})\n";
$code .= "${returnJSValueCode}";
« no previous file with comments | « no previous file | Source/bindings/scripts/unstable/v8_interface.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698