V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
file-visitor.cc
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "src/torque/file-visitor.h"
6 
7 #include "src/torque/declarable.h"
8 
9 namespace v8 {
10 namespace internal {
11 namespace torque {
12 
13 Signature FileVisitor::MakeSignature(const CallableNodeSignature* signature) {
14  LabelDeclarationVector definition_vector;
15  for (const auto& label : signature->labels) {
16  LabelDeclaration def = {label.name, GetTypeVector(label.types)};
17  definition_vector.push_back(def);
18  }
19  base::Optional<std::string> arguments_variable;
20  if (signature->parameters.has_varargs)
21  arguments_variable = signature->parameters.arguments_variable;
22  Signature result{signature->parameters.names,
23  arguments_variable,
24  {GetTypeVector(signature->parameters.types),
25  signature->parameters.has_varargs},
26  signature->parameters.implicit_count,
27  Declarations::GetType(signature->return_type),
28  definition_vector};
29  return result;
30 }
31 
32 } // namespace torque
33 } // namespace internal
34 } // namespace v8
Definition: libplatform.h:13