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".
|
||||
*/
|
||||
public type: string,
|
||||
options: CustomEventInit = {}
|
||||
options?: CustomEventInit
|
||||
) {
|
||||
// Avoid destructuring the options object (might save some nanoseconds).
|
||||
this.bubbles = options.bubbles === true;
|
||||
this.cancelable = options.cancelable === true;
|
||||
this.composed = options.composed === true;
|
||||
this.detail = options.detail === undefined ? null : options.detail;
|
||||
this.bubbles = options?.bubbles ?? false;
|
||||
this.cancelable = options?.cancelable ?? false;
|
||||
this.composed = options?.composed ?? false;
|
||||
this.detail = options?.detail ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user