Skip to content

Commit c981502

Browse files
committed
Merge remote-tracking branch 'upstream/1.0' into 1.1
2 parents ab0120f + f5f6905 commit c981502

File tree

7 files changed

+108
-38
lines changed

7 files changed

+108
-38
lines changed

lib/browser/neo4j-web.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28272,9 +28272,9 @@ module.exports = exports["default"];
2827228272
// Central place to detect feature support for the current platform,
2827328273
// expand as needed.
2827428274

28275-
"use strict";
28275+
'use strict';
2827628276

28277-
Object.defineProperty(exports, "__esModule", {
28277+
Object.defineProperty(exports, '__esModule', {
2827828278
value: true
2827928279
});
2828028280
var FEATURES = {
@@ -28283,8 +28283,8 @@ var FEATURES = {
2828328283
// This is insane. We are verifying that we have a version of getPeerCertificate
2828428284
// that supports reading the whole certificate, eg this commit:
2828528285
// https://github.com/nodejs/node/commit/345c40b6
28286-
var desc = require('tls').TLSSocket.prototype.getPeerCertificate.toString();
28287-
return desc.startsWith("function getPeerCertificate(detailed)");
28286+
var desc = require('tls').TLSSocket.prototype.getPeerCertificate;
28287+
return desc.length() >= 1;
2828828288
} catch (e) {
2828928289
return false;
2829028290
}
@@ -28295,8 +28295,8 @@ function hasFeature(name) {
2829528295
return FEATURES[name] && FEATURES[name]();
2829628296
}
2829728297

28298-
exports["default"] = hasFeature;
28299-
module.exports = exports["default"];
28298+
exports['default'] = hasFeature;
28299+
module.exports = exports['default'];
2830028300

2830128301
},{"tls":43}],152:[function(require,module,exports){
2830228302
/**
@@ -28468,17 +28468,27 @@ var Packer = (function () {
2846828468
} else if (x instanceof Array) {
2846928469
this.packListHeader(x.length);
2847028470
for (var i = 0; i < x.length; i++) {
28471-
this.pack(x[i]);
28471+
this.pack(x[i] === undefined ? null : x[i]);
2847228472
}
2847328473
} else if (x instanceof Structure) {
2847428474
this.packStruct(x.signature, x.fields);
2847528475
} else if (typeof x == "object") {
2847628476
var keys = Object.keys(x);
28477-
this.packMapHeader(keys.length);
28477+
28478+
var count = 0;
28479+
for (var i = 0; i < keys.length; i++) {
28480+
if (x[keys[i]] !== undefined) {
28481+
count++;
28482+
}
28483+
}
28484+
28485+
this.packMapHeader(count);
2847828486
for (var i = 0; i < keys.length; i++) {
2847928487
var key = keys[i];
28480-
this.packString(key);
28481-
this.pack(x[key]);
28488+
if (x[key] !== undefined) {
28489+
this.packString(key);
28490+
this.pack(x[key]);
28491+
}
2848228492
}
2848328493
} else {
2848428494
throw (0, _error.newError)("Cannot pack this value: " + x);

lib/browser/neo4j-web.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/browser/neo4j-web.test.js

Lines changed: 26 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/v1/internal/features.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
// Central place to detect feature support for the current platform,
2121
// expand as needed.
2222

23-
"use strict";
23+
'use strict';
2424

25-
Object.defineProperty(exports, "__esModule", {
25+
Object.defineProperty(exports, '__esModule', {
2626
value: true
2727
});
2828
var FEATURES = {
@@ -31,8 +31,8 @@ var FEATURES = {
3131
// This is insane. We are verifying that we have a version of getPeerCertificate
3232
// that supports reading the whole certificate, eg this commit:
3333
// https://github.com/nodejs/node/commit/345c40b6
34-
var desc = require('tls').TLSSocket.prototype.getPeerCertificate.toString();
35-
return desc.startsWith("function getPeerCertificate(detailed)");
34+
var desc = require('tls').TLSSocket.prototype.getPeerCertificate;
35+
return desc.length() >= 1;
3636
} catch (e) {
3737
return false;
3838
}
@@ -43,5 +43,5 @@ function hasFeature(name) {
4343
return FEATURES[name] && FEATURES[name]();
4444
}
4545

46-
exports["default"] = hasFeature;
47-
module.exports = exports["default"];
46+
exports['default'] = hasFeature;
47+
module.exports = exports['default'];

lib/v1/internal/packstream.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,27 @@ var Packer = (function () {
135135
} else if (x instanceof Array) {
136136
this.packListHeader(x.length);
137137
for (var i = 0; i < x.length; i++) {
138-
this.pack(x[i]);
138+
this.pack(x[i] === undefined ? null : x[i]);
139139
}
140140
} else if (x instanceof Structure) {
141141
this.packStruct(x.signature, x.fields);
142142
} else if (typeof x == "object") {
143143
var keys = Object.keys(x);
144-
this.packMapHeader(keys.length);
144+
145+
var count = 0;
146+
for (var i = 0; i < keys.length; i++) {
147+
if (x[keys[i]] !== undefined) {
148+
count++;
149+
}
150+
}
151+
152+
this.packMapHeader(count);
145153
for (var i = 0; i < keys.length; i++) {
146154
var key = keys[i];
147-
this.packString(key);
148-
this.pack(x[key]);
155+
if (x[key] !== undefined) {
156+
this.packString(key);
157+
this.pack(x[key]);
158+
}
149159
}
150160
} else {
151161
throw (0, _error.newError)("Cannot pack this value: " + x);

lib/v1/internal/util.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
/**
3+
* Copyright (c) 2002-2016 "Neo Technology,"
4+
* Network Engine for Objects in Lund AB [http://neotechnology.com]
5+
*
6+
* This file is part of Neo4j.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
21+
"use strict";
22+
23+
Object.defineProperty(exports, "__esModule", {
24+
value: true
25+
});
26+
var LOCALHOST_MATCHER = /^(localhost|127(\.\d+){3})$/i;
27+
var ENCRYPTION_ON = "ENCRYPTION_ON";
28+
var ENCRYPTION_OFF = "ENCRYPTION_OFF";
29+
var ENCRYPTION_NON_LOCAL = "ENCRYPTION_NON_LOCAL";
30+
31+
function isLocalHost(host) {
32+
return LOCALHOST_MATCHER.test(host);
33+
}
34+
35+
exports.isLocalHost = isLocalHost;
36+
exports.ENCRYPTION_ON = ENCRYPTION_ON;
37+
exports.ENCRYPTION_OFF = ENCRYPTION_OFF;
38+
exports.ENCRYPTION_NON_LOCAL = ENCRYPTION_NON_LOCAL;

src/v1/internal/features.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const FEATURES = {
2626
// This is insane. We are verifying that we have a version of getPeerCertificate
2727
// that supports reading the whole certificate, eg this commit:
2828
// https://github.com/nodejs/node/commit/345c40b6
29-
let desc = require('tls').TLSSocket.prototype.getPeerCertificate.toString();
30-
return desc.startsWith("function getPeerCertificate(detailed)");
29+
let desc = require('tls').TLSSocket.prototype.getPeerCertificate;
30+
return desc.length() >= 1;
3131
} catch( e ) {
3232
return false;
3333
}

0 commit comments

Comments
 (0)