MCPcopy Index your code
hub / github.com/nodejs/node / createModuleDeclaration

Function createModuleDeclaration

test/fixtures/snapshot/typescript.js:25240–25257  ·  view source on GitHub ↗
(decorators, modifiers, name, body, flags)

Source from the content-addressed store, hash-verified

25238 }
25239 // @api
25240 function createModuleDeclaration(decorators, modifiers, name, body, flags) {
25241 if (flags === void 0) { flags = 0 /* NodeFlags.None */; }
25242 var node = createBaseDeclaration(261 /* SyntaxKind.ModuleDeclaration */, decorators, modifiers);
25243 node.flags |= flags & (16 /* NodeFlags.Namespace */ | 4 /* NodeFlags.NestedNamespace */ | 1024 /* NodeFlags.GlobalAugmentation */);
25244 node.name = name;
25245 node.body = body;
25246 if (ts.modifiersToFlags(node.modifiers) & 2 /* ModifierFlags.Ambient */) {
25247 node.transformFlags = 1 /* TransformFlags.ContainsTypeScript */;
25248 }
25249 else {
25250 node.transformFlags |=
25251 propagateChildFlags(node.name) |
25252 propagateChildFlags(node.body) |
25253 1 /* TransformFlags.ContainsTypeScript */;
25254 }
25255 node.transformFlags &= ~16777216 /* TransformFlags.ContainsPossibleTopLevelAwait */; // Module declarations cannot contain `await`.
25256 return node;
25257 }
25258 // @api
25259 function updateModuleDeclaration(node, decorators, modifiers, name, body) {
25260 return node.decorators !== decorators

Callers 1

updateModuleDeclarationFunction · 0.85

Calls 2

createBaseDeclarationFunction · 0.85
propagateChildFlagsFunction · 0.85

Tested by

no test coverage detected