Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Concord JSHint Standards with Signal-Desktop, update to ES6 getPrototypeOf #48

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"debug" : false,
"eqnull" : false,
"es5" : false,
"esversion" : 6,
"esnext" : false,
"moz" : false,
"evil" : false,
Expand All @@ -37,13 +38,13 @@
"globalstrict" : false,
"iterator" : false,
"lastsemic" : false,
"laxbreak" : false,
"laxbreak" : true,
"laxcomma" : false,
"loopfunc" : false,
"multistr" : false,
"noyield" : false,
"notypeof" : false,
"proto" : true,
"proto" : false,
"scripturl" : false,
"shadow" : false,
"sub" : false,
Expand All @@ -67,5 +68,6 @@
"worker" : false,
"wsh" : false,
"yui" : false,
"globals" : {}
"globals" : {},
"-W100" : true
}
12 changes: 6 additions & 6 deletions src/SessionRecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ Internal.SessionRecord = function() {
var OLD_RATCHETS_MAX_LENGTH = 10;
var SESSION_RECORD_VERSION = 'v1';

var StaticByteBufferProto = new dcodeIO.ByteBuffer().__proto__;
var StaticArrayBufferProto = new ArrayBuffer().__proto__;
var StaticUint8ArrayProto = new Uint8Array().__proto__;
var StaticByteBufferProto = Object.getPrototypeOf(new dcodeIO.ByteBuffer());
var StaticArrayBufferProto = Object.getPrototypeOf(new ArrayBuffer());
var StaticUint8ArrayProto = Object.getPrototypeOf(new Uint8Array());

function isStringable(thing) {
return (thing === Object(thing) &&
(thing.__proto__ == StaticArrayBufferProto ||
thing.__proto__ == StaticUint8ArrayProto ||
thing.__proto__ == StaticByteBufferProto));
(Object.getPrototypeOf(thing) == StaticArrayBufferProto ||
Object.getPrototypeOf(thing) == StaticUint8ArrayProto ||
Object.getPrototypeOf(thing) == StaticByteBufferProto));
}
function ensureStringed(thing) {
if (typeof thing == "string" || typeof thing == "number" || typeof thing == "boolean") {
Expand Down
4 changes: 2 additions & 2 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
var util = (function() {
'use strict';

var StaticArrayBufferProto = new ArrayBuffer().__proto__;
var StaticArrayBufferProto = Object.getPrototypeOf(new ArrayBuffer());

return {
toString: function(thing) {
Expand All @@ -19,7 +19,7 @@ var util = (function() {
return undefined;
}
if (thing === Object(thing)) {
if (thing.__proto__ == StaticArrayBufferProto) {
if (Object.getPrototypeOf(thing) == StaticArrayBufferProto) {
return thing;
}
}
Expand Down