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

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

Issue 131973012: Add overload support for non-wrapper type vs. primitive type (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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/tests/idls/TestObject.idl » ('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 43df75f485c36b565f37b8095369e8c1ed2d568c..5dac61dc9a8ccf19fcc5254d3ef0cbef814c778f 100644
--- a/Source/bindings/scripts/code_generator_v8.pm
+++ b/Source/bindings/scripts/code_generator_v8.pm
@@ -2208,6 +2208,17 @@ sub GenerateParametersCheckExpression
} else {
push(@andExpression, "V8${type}::hasInstance($value, info.GetIsolate(), worldType(info.GetIsolate()))");
}
+ } elsif ($nonWrapperTypes{$type}) {
+ # Non-wrapper types are just objects: we don't distinguish type
+ # FIXME: If distinguishing non-wrapper type from primitive type,
+ # the non-wrapper type must appear *first* in the IDL file,
+ # since we're not adding a !IsObject check to primitive types.
+ # This can be avoided if compute overloads more sensibly.
+ if ($parameter->isNullable) {
+ push(@andExpression, "${value}->IsNull() || ${value}->IsObject()");
+ } else {
+ push(@andExpression, "${value}->IsObject()");
+ }
}
$parameterIndex++;
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698