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