Do not rely on global init order
This commit is contained in:
parent
0ef0fdf69a
commit
a838421181
@ -1,9 +1,11 @@
|
||||
namespace control {
|
||||
let nextComponentId = 20000;
|
||||
let nextComponentId: number;
|
||||
|
||||
export class Component {
|
||||
protected _id: number;
|
||||
constructor(id = 0) {
|
||||
if (!nextComponentId)
|
||||
nextComponentId = 20000
|
||||
if (!id) id = ++nextComponentId
|
||||
this._id = id
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user