mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 01:41:30 +00:00
Reintroduce builtin decorator so these can appear anywhere in stdlib again
Avoids wrapping an undocumented function within 'memory.size' for example.
This commit is contained in:
@ -1122,7 +1122,8 @@ export enum DecoratorKind {
|
||||
UNMANAGED,
|
||||
SEALED,
|
||||
INLINE,
|
||||
EXTERNAL
|
||||
EXTERNAL,
|
||||
BUILTIN
|
||||
}
|
||||
|
||||
/** Returns the kind of the specified decorator. Defaults to {@link DecoratorKind.CUSTOM}. */
|
||||
@ -1132,6 +1133,10 @@ export function decoratorNameToKind(name: Expression): DecoratorKind {
|
||||
let nameStr = (<IdentifierExpression>name).text;
|
||||
assert(nameStr.length);
|
||||
switch (nameStr.charCodeAt(0)) {
|
||||
case CharCode.b: {
|
||||
if (nameStr == "builtin") return DecoratorKind.BUILTIN;
|
||||
break;
|
||||
}
|
||||
case CharCode.e: {
|
||||
if (nameStr == "external") return DecoratorKind.EXTERNAL;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user