[Pkg-javascript-commits] [node-expat] 20/371: getError()

Jonas Smedegaard dr at jones.dk
Sun Feb 28 09:59:40 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository node-expat.

commit 72123e216952e7004f5ebf2a1b9ff3d62d41fcb6
Author: Astro <astro at spaceboyz.net>
Date:   Sun May 30 14:22:34 2010 +0200

    getError()
---
 expat.cc | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/expat.cc b/expat.cc
index 9f8cee9..aa9a26f 100644
--- a/expat.cc
+++ b/expat.cc
@@ -23,6 +23,7 @@ public:
 
     NODE_SET_PROTOTYPE_METHOD(t, "parse", Parse);
     NODE_SET_PROTOTYPE_METHOD(t, "setEncoding", SetEncoding);
+    NODE_SET_PROTOTYPE_METHOD(t, "getError", GetError);
 
     target->Set(String::NewSymbol("Parser"), t->GetFunction());
 
@@ -130,6 +131,21 @@ protected:
     return XML_SetEncoding(parser, encoding) != 0;
   }
 
+  static Handle<Value> GetError(const Arguments& args)
+  {
+    HandleScope scope;
+    Parser *parser = ObjectWrap::Unwrap<Parser>(args.This());
+
+    return scope.Close(String::New(parser->getError()));
+  }
+
+  const XML_LChar *getError()
+  {
+    enum XML_Error code;
+    code = XML_GetErrorCode(parser);
+    return XML_ErrorString(code);
+  }
+
 private:
   /* expat instance */
   XML_Parser parser;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-expat.git



More information about the Pkg-javascript-commits mailing list