mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: don't make an object unnecessarily
This commit is contained in:
@@ -166,13 +166,13 @@ export class DOMEvent implements Event {
|
|||||||
* Returns the type of event, e.g. "click", "hashchange", or "submit".
|
* Returns the type of event, e.g. "click", "hashchange", or "submit".
|
||||||
*/
|
*/
|
||||||
public type: string,
|
public type: string,
|
||||||
options: CustomEventInit = {}
|
options?: CustomEventInit
|
||||||
) {
|
) {
|
||||||
// Avoid destructuring the options object (might save some nanoseconds).
|
// Avoid destructuring the options object (might save some nanoseconds).
|
||||||
this.bubbles = options.bubbles === true;
|
this.bubbles = options?.bubbles ?? false;
|
||||||
this.cancelable = options.cancelable === true;
|
this.cancelable = options?.cancelable ?? false;
|
||||||
this.composed = options.composed === true;
|
this.composed = options?.composed ?? false;
|
||||||
this.detail = options.detail === undefined ? null : options.detail;
|
this.detail = options?.detail ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user