diff --git a/compiler/cpp/src/generate/t_js_generator.cc b/compiler/cpp/src/generate/t_js_generator.cc
index 7561b12..b6ca05a 100644
--- a/compiler/cpp/src/generate/t_js_generator.cc
+++ b/compiler/cpp/src/generate/t_js_generator.cc
@@ -576,6 +576,7 @@
     out << "Thrift.inherits(" <<
         js_namespace(tstruct->get_program()) <<
         tstruct->get_name() << ", Thrift.TException);" << endl;
+	out << js_namespace(tstruct->get_program())<<tstruct->get_name() <<".prototype.name = '" << tstruct->get_name() << "';" << endl;
   } else {
     //init prototype
     out << js_namespace(tstruct->get_program())<<tstruct->get_name() <<".prototype = {};\n";
diff --git a/lib/js/thrift.js b/lib/js/thrift.js
index 8b1733e..860cb99 100644
--- a/lib/js/thrift.js
+++ b/lib/js/thrift.js
@@ -72,14 +72,12 @@
 };
 
 
-Thrift.TException = {};
-Thrift.TException.prototype = {
-    initialize: function(message, code) {
-        this.message = message;
-        this.code = (code === null) ? 0 : code;
-    }
-};
 
+Thrift.TException = function(message) {
+    this.message = message;
+};
+Thrift.inherits(Thrift.TException, Error);
+Thrift.TException.prototype.name = 'TException';
 
 Thrift.TApplicationExceptionType = {
     'UNKNOWN' : 0,
@@ -94,80 +92,75 @@
     this.message = message;
     this.code = (code === null) ? 0 : code;
 };
+Thrift.inherits(Thrift.TApplicationException, Thrift.TException);
+Thrift.TApplicationException.prototype.name = 'TApplicationException';
 
-Thrift.TApplicationException.prototype = {
+Thrift.TApplicationException.prototype.read = function(input) {
+    while (1) {
+        var ret = input.readFieldBegin();
 
-    read: function(input) {
-        while (1) {
-            var ret = input.readFieldBegin();
+        if (ret.ftype == Thrift.Type.STOP) {
+            break;
+        }
 
-            if (ret.ftype == Thrift.Type.STOP) {
-                break;
-            }
+        var fid = ret.fid;
 
-            var fid = ret.fid;
-
-            switch (fid) {
-                case 1:
-                    if (ret.ftype == Thrift.Type.STRING) {
-                        ret = input.readString();
-                        this.message = ret.value;
-                    } else {
-                        ret = input.skip(ret.ftype);
-                    }
-
-                    break;
-                case 2:
-                    if (ret.ftype == Thrift.Type.I32) {
-                        ret = input.readI32();
-                        this.code = ret.value;
-                    } else {
-                        ret = input.skip(ret.ftype);
-                    }
-                    break;
-
-                default:
+        switch (fid) {
+            case 1:
+                if (ret.ftype == Thrift.Type.STRING) {
+                    ret = input.readString();
+                    this.message = ret.value;
+                } else {
                     ret = input.skip(ret.ftype);
-                    break;
-            }
-
-            input.readFieldEnd();
+                }
+                break;
+            case 2:
+                if (ret.ftype == Thrift.Type.I32) {
+                    ret = input.readI32();
+                    this.code = ret.value;
+                } else {
+                    ret = input.skip(ret.ftype);
+                }
+                break;
+           default:
+                ret = input.skip(ret.ftype);
+                break;
         }
 
-        input.readStructEnd();
-    },
-
-    write: function(output) {
-        var xfer = 0;
-
-        output.writeStructBegin('TApplicationException');
-
-        if (this.message) {
-            output.writeFieldBegin('message', Thrift.Type.STRING, 1);
-            output.writeString(this.getMessage());
-            output.writeFieldEnd();
-        }
-
-        if (this.code) {
-            output.writeFieldBegin('type', Thrift.Type.I32, 2);
-            output.writeI32(this.code);
-            output.writeFieldEnd();
-        }
-
-        output.writeFieldStop();
-        output.writeStructEnd();
-    },
-
-    getCode: function() {
-        return this.code;
-    },
-
-    getMessage: function() {
-        return this.message;
+        input.readFieldEnd();
     }
+
+    input.readStructEnd();
 };
 
+Thrift.TApplicationException.prototype.write = function(output) {
+    var xfer = 0;
 
+    output.writeStructBegin('TApplicationException');
+
+    if (this.message) {
+        output.writeFieldBegin('message', Thrift.Type.STRING, 1);
+        output.writeString(this.getMessage());
+        output.writeFieldEnd();
+    }
+
+    if (this.code) {
+        output.writeFieldBegin('type', Thrift.Type.I32, 2);
+        output.writeI32(this.code);
+        output.writeFieldEnd();
+    }
+
+    output.writeFieldStop();
+    output.writeStructEnd();
+};
+
+Thrift.TApplicationException.prototype.getCode = function() {
+    return this.code;
+};
+
+Thrift.TApplicationException.prototype.getMessage = function() {
+    return this.message;
+};
 
 /**
  *If you do not specify a url then you must handle ajax on your own.
