Skip to content

Commit

Permalink
use new node error constructor type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
kjin committed Dec 13, 2017
1 parent a78f721 commit a7afb58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/span-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ export class SpanData implements SpanDataInterface {

const origPrepare = Error.prepareStackTrace;
Error.prepareStackTrace =
(error: Error, structured: CallSite[]): CallSite[] => {
(error: Error, structured: NodeJS.CallSite[]): NodeJS.CallSite[] => {
return structured;
};
const e: {stack?: CallSite[]} = {};
const e: {stack?: NodeJS.CallSite[]} = {};
Error.captureStackTrace(e, SpanData);

const stackFrames: StackFrame[] = [];
Expand Down
25 changes: 0 additions & 25 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,6 @@ declare namespace NodeJS {
}
}

interface CallSite {
getThis: () => any | undefined;
getTypeName: () => string;
getFunction: () => Function | undefined;
getFunctionName: () => string;
getMethodName: () => string;
getFileName: () => string | undefined;
getLineNumber: () => number | undefined;
getColumnNumber: () => number | undefined;
getEvalOrigin: () => CallSite | undefined;
isToplevel: () => boolean;
isEval: () => boolean;
isNative: () => boolean;
isConstructor: () => boolean;
}

interface ErrorConstructor {
prepareStackTrace?: (
error: Error,
structuredStackTrace: CallSite[]
) => CallSite[] | string;
captureStackTrace(targetObject: Object, constructorOpt?: Function): void;
stackTraceLimit: number;
}

declare module '@google-cloud/common' {
import * as request from 'request';

Expand Down

0 comments on commit a7afb58

Please sign in to comment.