Rework NodeJS / Javascript consistency
Client: js
* Re-worked consistency of browser.js and index.js in lib/nodejs
* Wrap non-standard V8 method 'Error.captureStackTrace()'
diff --git a/lib/js/src/thrift.js b/lib/js/src/thrift.js
index c682605..123f526 100644
--- a/lib/js/src/thrift.js
+++ b/lib/js/src/thrift.js
@@ -284,10 +284,9 @@
Thrift.TProtocolException = function TProtocolException(type, message) {
Error.call(this);
- if (Error.captureStackTrace) {
+ if (Error.captureStackTrace !== undefined) {
Error.captureStackTrace(this, this.constructor);
}
-
this.name = this.constructor.name;
this.type = type;
this.message = message;