Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/torque/declaration-visitor.cc')
-rw-r--r--deps/v8/src/torque/declaration-visitor.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/deps/v8/src/torque/declaration-visitor.cc b/deps/v8/src/torque/declaration-visitor.cc
index 5e3c8bbcb26..99b7bdddcd1 100644
--- a/deps/v8/src/torque/declaration-visitor.cc
+++ b/deps/v8/src/torque/declaration-visitor.cc
@@ -103,6 +103,10 @@ Builtin* DeclarationVisitor::CreateBuiltin(BuiltinDeclaration* decl,
*signature.return_type, ".");
}
+ if (signature.return_type == TypeOracle::GetVoidType()) {
+ Error("Builtins cannot have return type void.");
+ }
+
return Declarations::CreateBuiltin(std::move(external_name),
std::move(readable_name), kind,
std::move(signature), body);
@@ -122,11 +126,12 @@ void DeclarationVisitor::Visit(ExternalRuntimeDeclaration* decl) {
"Missing parameters for runtime function, at least the context "
"parameter is required.");
}
- if (!(signature.parameter_types.types[0] == TypeOracle::GetContextType())) {
+ if (!(signature.parameter_types.types[0] == TypeOracle::GetContextType() ||
+ signature.parameter_types.types[0] == TypeOracle::GetNoContextType())) {
ReportError(
"first parameter to runtime functions has to be the context and have "
- "type Context, but found type ",
- signature.parameter_types.types[0]);
+ "type Context or NoContext, but found type ",
+ *signature.parameter_types.types[0]);
}
if (!(signature.return_type->IsSubtypeOf(TypeOracle::GetObjectType()) ||
signature.return_type == TypeOracle::GetVoidType() ||