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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 910313002: Rename IsConstructor to IsGenerativeConstructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index ccae5e280d8b0810e03f9b7c9f0041b91d768899..64b96c805bd422c87c9f5b4cc7469a2afc4c9d7d 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -2684,7 +2684,7 @@ static RawObject* ThrowArgumentError(const char* exception_message) {
ASSERT(result.IsFunction());
Function& constructor = Function::Handle(isolate);
constructor ^= result.raw();
- if (!constructor.IsConstructor()) {
+ if (!constructor.IsGenerativeConstructor()) {
const String& message = String::Handle(
String::NewFormatted("%s: class '%s' is not a constructor.",
CURRENT_FUNC, class_name.ToCString()));
@@ -3151,7 +3151,7 @@ static Dart_Handle NewByteData(Isolate* isolate, intptr_t length) {
ASSERT(!result.IsNull());
ASSERT(result.IsFunction());
const Function& factory = Function::Cast(result);
- ASSERT(!factory.IsConstructor());
+ ASSERT(!factory.IsGenerativeConstructor());
// Create the argument list.
const Array& args = Array::Handle(isolate, Array::New(2));
@@ -3200,7 +3200,7 @@ static Dart_Handle NewExternalByteData(
ASSERT(!result.IsNull());
ASSERT(result.IsFunction());
const Function& factory = Function::Cast(result);
- ASSERT(!factory.IsConstructor());
+ ASSERT(!factory.IsGenerativeConstructor());
// Create the argument list.
const intptr_t num_args = 3;
@@ -3381,7 +3381,7 @@ DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data) {
ASSERT(!result.IsNull());
ASSERT(result.IsFunction());
const Function& factory = Function::Cast(result);
- ASSERT(!factory.IsConstructor());
+ ASSERT(!factory.IsGenerativeConstructor());
// Create the argument list.
const Array& args = Array::Handle(isolate, Array::New(2));
@@ -3526,7 +3526,7 @@ static RawObject* ResolveConstructor(const char* current_func,
const Function& constructor =
Function::Handle(cls.LookupFunctionAllowPrivate(constr_name));
if (constructor.IsNull() ||
- (!constructor.IsConstructor() && !constructor.IsFactory())) {
+ (!constructor.IsGenerativeConstructor() && !constructor.IsFactory())) {
const String& lookup_class_name = String::Handle(cls.Name());
if (!class_name.Equals(lookup_class_name)) {
// When the class name used to build the constructor name is
@@ -3548,7 +3548,7 @@ static RawObject* ResolveConstructor(const char* current_func,
return ApiError::New(message);
}
}
- int extra_args = (constructor.IsConstructor() ? 2 : 1);
+ int extra_args = (constructor.IsGenerativeConstructor() ? 2 : 1);
String& error_message = String::Handle();
if (!constructor.AreValidArgumentCounts(num_args + extra_args,
0,
@@ -3651,17 +3651,17 @@ DART_EXPORT Dart_Handle Dart_New(Dart_Handle type,
cls = type_obj.type_class();
}
- if (constructor.IsConstructor()) {
+ if (constructor.IsGenerativeConstructor()) {
// Create the new object.
new_object = Instance::New(cls);
}
// Create the argument list.
intptr_t arg_index = 0;
- int extra_args = (constructor.IsConstructor() ? 2 : 1);
+ int extra_args = (constructor.IsGenerativeConstructor() ? 2 : 1);
const Array& args =
Array::Handle(isolate, Array::New(number_of_arguments + extra_args));
- if (constructor.IsConstructor()) {
+ if (constructor.IsGenerativeConstructor()) {
// Constructors get the uninitialized object and a constructor phase.
if (!type_arguments.IsNull()) {
// The type arguments will be null if the class has no type parameters, in
@@ -3697,7 +3697,7 @@ DART_EXPORT Dart_Handle Dart_New(Dart_Handle type,
return Api::NewHandle(isolate, result.raw());
}
- if (constructor.IsConstructor()) {
+ if (constructor.IsGenerativeConstructor()) {
ASSERT(result.IsNull());
} else {
ASSERT(result.IsNull() || result.IsInstance());
@@ -3855,7 +3855,7 @@ DART_EXPORT Dart_Handle Dart_InvokeConstructor(Dart_Handle object,
Function::Handle(isolate, cls.LookupFunctionAllowPrivate(dot_name));
const int extra_args = 2;
if (!constructor.IsNull() &&
- constructor.IsConstructor() &&
+ constructor.IsGenerativeConstructor() &&
constructor.AreValidArgumentCounts(number_of_arguments + extra_args,
0,
NULL)) {
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698