mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-09 21:11:27 +00:00
Legalize external decorator for generic functions
This commit is contained in:
parent
06ee43e6ad
commit
cc5522d6cc
@ -1527,16 +1527,18 @@ export class Program extends DiagnosticEmitter {
|
||||
): void {
|
||||
var name = declaration.name.text;
|
||||
var validDecorators = DecoratorFlags.NONE;
|
||||
if (!declaration.is(CommonFlags.AMBIENT)) {
|
||||
if (declaration.is(CommonFlags.AMBIENT)) {
|
||||
validDecorators |= DecoratorFlags.EXTERNAL;
|
||||
} else {
|
||||
validDecorators |= DecoratorFlags.INLINE;
|
||||
}
|
||||
if (parent.kind != ElementKind.CLASS_PROTOTYPE && !declaration.is(CommonFlags.INSTANCE)) {
|
||||
validDecorators |= DecoratorFlags.GLOBAL;
|
||||
if (!declaration.is(CommonFlags.INSTANCE)) {
|
||||
if (parent.kind != ElementKind.CLASS_PROTOTYPE) {
|
||||
validDecorators |= DecoratorFlags.GLOBAL;
|
||||
}
|
||||
}
|
||||
if (!declaration.is(CommonFlags.GENERIC)) {
|
||||
if (declaration.is(CommonFlags.AMBIENT)) {
|
||||
validDecorators |= DecoratorFlags.EXTERNAL;
|
||||
} else if (parent.kind == ElementKind.FILE && (<File>parent).source.isEntry) {
|
||||
if (parent.kind == ElementKind.FILE && (<File>parent).source.isEntry) {
|
||||
validDecorators |= DecoratorFlags.START;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user