mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 22:41:27 +00:00
Infer u32 from 32-bit integer literals if MSB is set
This commit is contained in:
@ -10,6 +10,7 @@ export class Symbol {
|
||||
if (!stringToId) { stringToId = new Map(); idToString = new Map(); }
|
||||
else if (stringToId.has(key)) return changetype<Symbol>(stringToId.get(key));
|
||||
var id = nextId++;
|
||||
if (!id) unreachable(); // out of ids
|
||||
stringToId.set(key, id);
|
||||
idToString.set(id, key);
|
||||
return changetype<Symbol>(id);
|
||||
@ -22,6 +23,8 @@ export class Symbol {
|
||||
}
|
||||
|
||||
constructor(description: string | null = null) {
|
||||
return changetype<Symbol>(nextId++);
|
||||
var id = nextId++;
|
||||
if (!id) unreachable(); // out of ids
|
||||
return changetype<Symbol>(id);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user