Skip to content

Commit 7bf653f

Browse files
committed
Merge tag 'v0.18.7' into mt
Switched Travis and AppVeyor releases over to my own release tokens.
2 parents 20f75b9 + 5ca9deb commit 7bf653f

17 files changed

+164
-61
lines changed

.travis.yml

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
11
language: node_js
2-
32
env:
4-
- CXX=g++-4.8
5-
3+
- CXX=g++-4.8
4+
os:
5+
- linux
6+
- osx
67
node_js:
7-
- "0.10"
8-
- "0.12"
9-
- iojs-1
10-
- iojs-2
11-
- iojs-3
12-
- 4
13-
- 6
14-
8+
- '0.10'
9+
- '0.12'
10+
- 4
11+
- 6
12+
- 7
13+
- 8
1514
addons:
16-
apt:
17-
sources:
18-
- ubuntu-toolchain-r-test
19-
packages:
20-
- g++-4.8
21-
15+
apt:
16+
sources:
17+
- ubuntu-toolchain-r-test
18+
packages:
19+
- g++-4.8
2220
sudo: false
23-
2421
before_install:
25-
- $CXX --version
26-
- case ${TRAVIS_NODE_VERSION} in 0.8*|0.10*) npm install -g npm@2 ;; esac
22+
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then export CXX=clang; fi
23+
- $CXX --version
24+
25+
- PUBLISH_BINARY=false
26+
- echo $TRAVIS_BRANCH
27+
- echo `git describe --tags --always HEAD`
28+
29+
- case ${TRAVIS_NODE_VERSION} in 0.8*|0.10*) npm install -g npm@2 ;; esac
30+
- npm config set progress false
31+
- npm config set spin false
32+
- npm install -g node-gyp node-pre-gyp
33+
install:
34+
- npm install --build-from-source
35+
before_deploy:
36+
- node-pre-gyp package 2>&1
37+
deploy:
38+
provider: releases
39+
api_key:
40+
secure: QJAG0W3SQBcP/rQpDgqeKXR4hccspyNe1GGyRVO8TlxEBCn6+UcfqMQbgqnpwtNBce/3D1CwyRrkl+zigvN6aoU7T4YjNcHqxx0Srmqvf146+HFMrl9eAXWt8U8xQT0aoPUrTNQybSqF27IvecePOEQ3KmwpwI/IXGUFA7JxEis++nznFRCSq74nq6HPJ8Ht3Ek7zx/kEn4puPcDlXFDm3k0YmX8A1hPQ3qfNRuIpsBrSomnbPZQbIB+/+egs5pHxbQkaihTLULuVrt5A0Dd5Zh6fs8fqTywKCacAhRvbrbNzGDlLc/FVR9VR0/ucV7bp28S3DILFhx5oJeBAkev92wbD+TLg9a2fxU1yMTjdyVuH7lJcy8AhjeokngyYj4L6Dbw92HdCxxj9UqaE6/T8Z51NbJBgJqZpfGoX8D48ynROYhXmL3TSdp7b5XDx9525czf7eiyG1HthnLppwo5qwkvaqI/J4lqljxHDQGxVvjwoQuJ3Hg/YVC6ASmyJCu0ulJfRAIaqQ35xx1Pfwdk2ZGxQ0pFHjWd4jJBkK9B2TM+kB9ObODaSLn9a3ncP4HlcNbVRwRw5BX5hLsVLE3MVhlLgBVm3bbvoY7233GkiykLOY/qXyqn15O/Zn9y1RoLTzyfhkJclbwXZ0PSpQ7YhD5LmvSJnwZtOTl3wYbxX/s=
41+
file: build/stage/libxmljs/libxmljs/releases/download/**/*.tar.gz
42+
file_glob: true
43+
skip_cleanup: true
44+
on:
45+
repo: gagern/libxmljs
46+
tags: true
47+
condition: $TRAVIS_TAG == v[0-9]*-mt

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Libxmljs-mt
22
[![Build Status](https://secure.travis-ci.org/gagern/libxmljs.svg?branch=master)](http://travis-ci.org/gagern/libxmljs)
33

4+
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/64dea28o6yuaq7om/branch/master?svg=true)](https://ci.appveyor.com/project/gagern/libxmljs/branch/master)
5+
46
This project is a fork of [libxmljs](https://github.com/libxmljs/libxmljs).
5-
The current version 0.18.0 is based on libxmljs 0.18.0 and libxml 2.9.4.
7+
The current version 0.18.1 is based on libxmljs 0.18.7 and libxml 2.9.4.
68

79
Libxmljs was originally designed with single-threaded operations in mind.
810
There are no asynchroneous operations for things like parsing XML documents.
@@ -97,4 +99,3 @@ Start by checking out the open issues both for [the upstream project](https://gi
9799
### Requirements
98100

99101
Make sure you have met the requirements for [node-gyp](https://github.com/TooTallNate/node-gyp#installation). You *do not* need to manually install node-gyp; it comes bundled with node.
100-

appveyor.yml

Lines changed: 63 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,73 @@
11
environment:
2-
matrix:
3-
- nodejs_version: LTS
4-
- nodejs_version: Stable
2+
npm_version: latest
3+
gyp_version: latest
4+
pre_gyp_version: latest
5+
github_release_token:
6+
secure: rI8VrSUANI+Slubd7OIzW6YNSyEmnAEpl2EYsN+CtXYcup4svkPQnqwWM2J70FPM
7+
matrix:
8+
- nodejs_version: 0.10
9+
npm_version: 4.0.3
10+
gyp_version: 3.5.0
11+
pre_gyp_version: 0.6.36
12+
- nodejs_version: 0.12
13+
npm_version: 4.0.3
14+
gyp_version: 3.5.0
15+
pre_gyp_version: 0.6.36
16+
- nodejs_version: 4
17+
- nodejs_version: 5
18+
- nodejs_version: 6
19+
- nodejs_version: 7
20+
- nodejs_version: 8
521

6-
os:
7-
- Visual Studio 2013
8-
- Visual Studio 2015
22+
platform:
23+
- x86
24+
- x64
25+
26+
image: Visual Studio 2015
27+
28+
artifacts:
29+
- path: build\**\*.tar.gz
30+
name: libxml_binary
931

1032
install:
11-
- ps: Install-Product node $env:nodejs_version
12-
- node --version
33+
- ps: Install-Product node $env:nodejs_version $env:platform
34+
- npm --version
35+
- npm config set msvs_version 2015
36+
- npm config set python C:\Python27\python.exe
37+
- npm install -g npm@%npm_version%
1338
- npm --version
14-
- git submodule update --init --recursive
39+
- npm install -g node-gyp@%gyp_version%
40+
- npm install -g node-pre-gyp@%pre_gyp_version%
41+
42+
# work around an issue with node-gyp v3.3.1 and node 4x
43+
# https://github.com/nodejs/node-gyp/issues/921
44+
- npm config set -g cafile=package.json
45+
- npm config set -g strict-ssl=false
46+
- npm config set registry http://registry.npmjs.org/
1547

1648
build_script:
17-
- npm install
49+
- npm install --msvs_version=2015
1850

1951
test_script:
20-
- npm test
52+
- node --expose-gc node_modules/nodeunit/bin/nodeunit test
53+
54+
after_test:
55+
- node-pre-gyp package 2>&1
56+
57+
deploy:
58+
- provider: GitHub
59+
release: $(APPVEYOR_REPO_TAG_NAME)
60+
artifact: libxml_binary
61+
auth_token: $(github_release_token)
62+
draft: false
63+
prerelease: false
64+
on:
65+
appveyor_repo_tag: true
2166

22-
deploy: off
67+
after_deploy:
68+
- npm config delete -g cafile
69+
- npm config delete -g strict-ssl
70+
- npm config delete registry
71+
- node-pre-gyp clean
72+
- npm install --fallback-to-build=false
73+
- node --expose-gc node_modules/nodeunit/bin/nodeunit test

binding.gyp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
'vendor/libxml/include',
1111
"<!(node -e \"require('nan')\")"
1212
],
13+
'cflags': [ '-Wall' ],
14+
'xcode_settings': {
15+
'OTHER_CFLAGS': [ '-Wall' ]
16+
},
1317
'sources': [
1418
'src/libxmljs.cc',
1519
'src/xml_attribute.cc',
@@ -59,7 +63,7 @@
5963
'vendor/libxml/xmlunicode.c',
6064
'vendor/libxml/xmlwriter.c',
6165
'vendor/libxml/xpath.c',
62-
'vendor/libxml/xpointer.c',
66+
'vendor/libxml/xpointer.c'
6367
],
6468
'defines': [
6569
'IN_LIBXMLJS',
@@ -70,6 +74,7 @@
7074
# node-gyp 2.x doesn't add this anymore
7175
# https://github.com/TooTallNate/node-gyp/pull/612
7276
'xcode_settings': {
77+
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
7378
'OTHER_LDFLAGS': [
7479
'-undefined dynamic_lookup'
7580
],

lib/document.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ module.exports.fromHtmlFragment = function(string, opts) {
155155
throw new Error('fromHtmlFragment options must be an object');
156156
}
157157

158-
opts.excludeImpliedElements = true;
158+
opts.doctype = false;
159+
opts.implied = false;
159160

160161
return bindings.fromHtml(string, opts);
161162
};

package.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@
66
"Roman Shtylman",
77
"Martin von Gagern <[email protected]>"
88
],
9+
"binary": {
10+
"module_name" : "xmljs",
11+
"module_path" : "./build/Release/",
12+
"host" : "https://github.com",
13+
"remote_path" : "./gagern/libxmljs/releases/download/v{version}-mt/",
14+
"package_name": "{node_abi}-{platform}-{arch}.tar.gz"
15+
},
916
"description": "multi-threaded libxml bindings for v8 javascript engine",
10-
"version": "0.18.0",
17+
"version": "0.18.1",
1118
"scripts": {
12-
"test": "node --expose_gc node_modules/nodeunit/bin/nodeunit test"
19+
"install": "node-pre-gyp install --fallback-to-build --loglevel http",
20+
"test": "node --expose_gc ./node_modules/.bin/nodeunit test"
1321
},
1422
"repository": {
1523
"type": "git",
@@ -24,10 +32,11 @@
2432
"node": ">=0.8.0"
2533
},
2634
"dependencies": {
27-
"bindings": "^1.2.1",
28-
"nan": "^2.3.2"
35+
"node-pre-gyp": "~0.6.32",
36+
"bindings": "1.2.1",
37+
"nan": "~2.5.0"
2938
},
3039
"devDependencies": {
31-
"nodeunit": "^0.9.0"
40+
"nodeunit": "0.9.0"
3241
}
3342
}

src/libxmljs.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,25 @@ void adjustMem(ssize_t diff)
5959
// our cleanup routines for libxml will be called (freeing memory)
6060
// but v8 is already offline and does not need to be informed
6161
// trying to adjust after shutdown will result in a fatal error
62-
#if (NODE_MODULE_VERSION > 0x000B)
62+
#if (NODE_MODULE_VERSION > 14)
63+
if (v8::Isolate::GetCurrent() == 0 ||
64+
v8::Isolate::GetCurrent()->IsDead())
65+
{
66+
return;
67+
}
68+
#elif (NODE_MODULE_VERSION > 0x000B)
6369
if (v8::Isolate::GetCurrent() == 0)
6470
{
6571
assert(diff <= 0);
6672
return;
6773
}
68-
#endif
74+
#else
6975
if (v8::V8::IsDead())
7076
{
7177
assert(diff <= 0);
7278
return;
7379
}
80+
#endif
7481
actuallyAdjustMem(diff);
7582
}
7683

src/xml_attribute.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ XmlAttribute::New(xmlNode* xml_obj, const xmlChar* name, const xmlChar* value)
2323
}
2424

2525
XmlAttribute* attribute = new XmlAttribute(attr);
26-
v8::Local<v8::Object> obj = Nan::New(constructor_template)->GetFunction()->NewInstance();
26+
v8::Local<v8::Object> obj = Nan::NewInstance(Nan::New(constructor_template)->GetFunction()).ToLocalChecked();
2727
attribute->Wrap(obj);
2828
return scope.Escape(obj);
2929
}
@@ -39,7 +39,7 @@ XmlAttribute::New(xmlAttr* attr)
3939
}
4040

4141
XmlAttribute* attribute = new XmlAttribute(attr);
42-
v8::Local<v8::Object> obj = Nan::New(constructor_template)->GetFunction()->NewInstance();
42+
v8::Local<v8::Object> obj = Nan::NewInstance(Nan::New(constructor_template)->GetFunction()).ToLocalChecked();
4343
attribute->Wrap(obj);
4444
return scope.Escape(obj);
4545
}

src/xml_comment.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ XmlComment::New(xmlNode* node)
8787
}
8888

8989
XmlComment* comment = new XmlComment(node);
90-
v8::Local<v8::Object> obj = Nan::New(constructor_template)->GetFunction()->NewInstance();
90+
v8::Local<v8::Object> obj = Nan::NewInstance(Nan::New(constructor_template)->GetFunction()).ToLocalChecked();
9191
comment->Wrap(obj);
9292
return scope.Escape(obj);
9393
}

src/xml_document.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ XmlDocument::New(xmlDoc* doc)
250250
return scope.Escape(static_cast<XmlDocument*>(doc->_private)->handle());
251251
}
252252

253-
v8::Local<v8::Object> obj = Nan::New(constructor_template)->GetFunction()->NewInstance();
253+
v8::Local<v8::Object> obj = Nan::NewInstance(Nan::New(constructor_template)->GetFunction()).ToLocalChecked();
254254

255255
XmlDocument* document = Nan::ObjectWrap::Unwrap<XmlDocument>(obj);
256256

@@ -413,8 +413,6 @@ NAN_METHOD(XmlDocument::FromXml)
413413
Nan::New<v8::String>("baseUrl").ToLocalChecked());
414414
v8::Local<v8::Value> encodingOpt = options->Get(
415415
Nan::New<v8::String>("encoding").ToLocalChecked());
416-
v8::Local<v8::Value> excludeImpliedElementsOpt = options->Get(
417-
Nan::New<v8::String>("excludeImpliedElements").ToLocalChecked());
418416

419417
// the base URL that will be used for this document
420418
v8::String::Utf8Value baseUrl_(baseUrlOpt->ToString());

0 commit comments

Comments
 (0)