From 9533a030f34097d5ae91c0fd9009578b3932bbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=B7=E6=B8=A1?= Date: Tue, 3 Sep 2019 15:10:05 +0800 Subject: Avoid prototype builtin `hasOwnProperty` (denoland/deno_std#577) Original: https://github.com/denoland/deno_std/commit/d36bff3fbe22a3585d23213e3f4c9f58756c032b --- ws/mod.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ws') diff --git a/ws/mod.ts b/ws/mod.ts index df8cab01f..b649ef178 100644 --- a/ws/mod.ts +++ b/ws/mod.ts @@ -1,6 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import { decode, encode } from "../strings/mod.ts"; +import { hasOwnProperty } from "../util/has_own_property.ts"; type Conn = Deno.Conn; type Writer = Deno.Writer; @@ -34,7 +35,7 @@ export interface WebSocketCloseEvent { export function isWebSocketCloseEvent( a: WebSocketEvent ): a is WebSocketCloseEvent { - return typeof a === "object" && a.hasOwnProperty("code"); + return hasOwnProperty(a, "code"); } export type WebSocketPingEvent = ["ping", Uint8Array]; -- cgit v1.2.3