Skip to content

Commit 46c74a4

Browse files
author
Travis CI
committed
Deploy f01da1b to NPM branch
1 parent b9aae06 commit 46c74a4

File tree

9 files changed

+40
-17
lines changed

9 files changed

+40
-17
lines changed

error/GraphQLError.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ var _printError = require("./printError");
99

1010
var _location = require("../language/location");
1111

12-
/**
13-
* Copyright (c) Facebook, Inc. and its affiliates.
14-
*
15-
* This source code is licensed under the MIT license found in the
16-
* LICENSE file in the root directory of this source tree.
17-
*
18-
*
19-
*/
12+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
13+
2014
function GraphQLError( // eslint-disable-line no-redeclare
2115
message, nodes, source, positions, path, originalError, extensions) {
2216
// Compute list of blame nodes.
@@ -62,7 +56,15 @@ message, nodes, source, positions, path, originalError, extensions) {
6256
}, []);
6357
}
6458

65-
var _extensions = extensions || originalError && originalError.extensions;
59+
var _extensions = extensions;
60+
61+
if (_extensions == null && originalError != null) {
62+
var originalExtensions = originalError.extensions;
63+
64+
if (originalExtensions != null && _typeof(originalExtensions) === 'object') {
65+
_extensions = originalExtensions;
66+
}
67+
}
6668

6769
Object.defineProperties(this, {
6870
message: {

error/GraphQLError.js.flow

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,13 @@ export function GraphQLError( // eslint-disable-line no-redeclare
138138
}, []);
139139
}
140140

141-
const _extensions = extensions || (originalError && originalError.extensions);
141+
let _extensions = extensions;
142+
if (_extensions == null && originalError != null) {
143+
const originalExtensions = originalError.extensions;
144+
if (originalExtensions != null && typeof originalExtensions === 'object') {
145+
_extensions = originalExtensions;
146+
}
147+
}
142148

143149
Object.defineProperties(this, {
144150
message: {

error/GraphQLError.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2+
13
/**
24
* Copyright (c) Facebook, Inc. and its affiliates.
35
*
@@ -60,7 +62,15 @@ message, nodes, source, positions, path, originalError, extensions) {
6062
}, []);
6163
}
6264

63-
var _extensions = extensions || originalError && originalError.extensions;
65+
var _extensions = extensions;
66+
67+
if (_extensions == null && originalError != null) {
68+
var originalExtensions = originalError.extensions;
69+
70+
if (originalExtensions != null && _typeof(originalExtensions) === 'object') {
71+
_extensions = originalExtensions;
72+
}
73+
}
6474

6575
Object.defineProperties(this, {
6676
message: {

jsutils/inspect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function formatObjectValue(value, previouslySeenValues) {
4747
if (value) {
4848
var customInspectFn = getCustomFn(value);
4949

50-
if (customInspectFn) {
50+
if (customInspectFn !== undefined) {
5151
// $FlowFixMe(>=0.90.0)
5252
var customValue = customInspectFn.call(value); // check for infinite recursion
5353

jsutils/inspect.js.flow

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function formatObjectValue(value, previouslySeenValues) {
4141
if (value) {
4242
const customInspectFn = getCustomFn(value);
4343

44-
if (customInspectFn) {
44+
if (customInspectFn !== undefined) {
4545
// $FlowFixMe(>=0.90.0)
4646
const customValue = customInspectFn.call(value);
4747

jsutils/inspect.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function formatObjectValue(value, previouslySeenValues) {
4545
if (value) {
4646
var customInspectFn = getCustomFn(value);
4747

48-
if (customInspectFn) {
48+
if (customInspectFn !== undefined) {
4949
// $FlowFixMe(>=0.90.0)
5050
var customValue = customInspectFn.call(value); // check for infinite recursion
5151

jsutils/invariant.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ exports.default = invariant;
1414
*
1515
*/
1616
function invariant(condition, message) {
17+
var booleanCondition = Boolean(condition);
1718
/* istanbul ignore else */
18-
if (!condition) {
19+
20+
if (!booleanCondition) {
1921
throw new Error(message);
2022
}
2123
}

jsutils/invariant.js.flow

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
*/
99

1010
export default function invariant(condition: mixed, message: string) {
11+
const booleanCondition = Boolean(condition);
1112
/* istanbul ignore else */
12-
if (!condition) {
13+
if (!booleanCondition) {
1314
throw new Error(message);
1415
}
1516
}

jsutils/invariant.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
*
88
*/
99
export default function invariant(condition, message) {
10+
var booleanCondition = Boolean(condition);
1011
/* istanbul ignore else */
11-
if (!condition) {
12+
13+
if (!booleanCondition) {
1214
throw new Error(message);
1315
}
1416
}

0 commit comments

Comments
 (0)