Skip to content

Making xmlError js friendly.#3

Closed
gotama wants to merge 4 commits intocdegalitt:masterfrom
gotama:master
Closed

Making xmlError js friendly.#3
gotama wants to merge 4 commits intocdegalitt:masterfrom
gotama:master

Conversation

@gotama
Copy link
Copy Markdown

@gotama gotama commented Sep 17, 2020

With regards to #2

Copy link
Copy Markdown
Owner

@cdegalitt cdegalitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but as of now, I cannot merge this PR due to multiple questions and styling issues.

Comment thread index.js
* @param {string} sourcePath - path to xml document
* @returns The parsed Schema
*/
exports.parseXml = function(sourcePath, options) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary, since you can use the underlying libxmljs, which is exported from this library.
See: line 13 of the very same index.js.

Comment thread package.json
{
"name": "libxmljs2-xsd",
"version": "0.26.3",
"name": "ksys-libxmljs2-xsd",
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot accept your PR with a name change to the library

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will create a new branch and change the name back to the original

Comment thread src/xml_errors.cc

void set_string_field(Local<Object> obj, const char *name, const char *value) {
void set_string_field(Local<Object> obj, const char *name, const char *value)
{
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know there is no style guide yet, but if we are to enforce oldschool "c-style" single-lined brackets, it should be done throughout the whole codebase. For now, IMHO, we should keep as-is.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes agree, will revert

Comment thread src/xml_errors.cc
Local<Value> err =
Exception::Error(Nan::New<String>(error->message).ToLocalChecked());
Local<Object> out = Local<Object>::Cast(err);
Local<Object> out = Nan::New<Object>();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wouldn't we want to create a JavaScript Error object ?
IMHO, it is useful since it indicates that this is an error/exception that could also be thrown, or logged with a proper stack trace.

@gotama
Copy link
Copy Markdown
Author

gotama commented Oct 29, 2020

closing this PR as wrong branch is being merged in.

#5

@gotama gotama closed this Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants