summaryrefslogtreecommitdiff
path: root/ws
diff options
context:
space:
mode:
author迷渡 <justjavac@gmail.com>2019-09-03 15:10:05 +0800
committerRyan Dahl <ry@tinyclouds.org>2019-09-03 03:10:05 -0400
commit9533a030f34097d5ae91c0fd9009578b3932bbea (patch)
treedb4fa9f7474cecbc08048eca8e7c26a87b80d61e /ws
parentdd6db011e3a93f508f49ce1de84962a4ca23c587 (diff)
Avoid prototype builtin `hasOwnProperty` (denoland/deno_std#577)
Original: https://github.com/denoland/deno_std/commit/d36bff3fbe22a3585d23213e3f4c9f58756c032b
Diffstat (limited to 'ws')
-rw-r--r--ws/mod.ts3
1 files changed, 2 insertions, 1 deletions
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];