forked from github/cordova-android
Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c0df73c3c1 | ||
![]() |
211a7fc6a8 | ||
![]() |
ce67804b65 | ||
![]() |
f3ded26e35 | ||
![]() |
4b688f8715 | ||
![]() |
e3b3bcd75f | ||
![]() |
5a7590397d | ||
![]() |
af31c83ec1 | ||
![]() |
bd94735ba2 | ||
![]() |
46e47a3c5c | ||
![]() |
814aca2b68 | ||
![]() |
cf159c1ae3 | ||
![]() |
4868d5e59e | ||
![]() |
34c7e8a534 | ||
![]() |
d36cfeafa2 | ||
![]() |
d2c71e7d75 | ||
![]() |
fc8cd37495 | ||
![]() |
3f1113ed8f | ||
![]() |
4d55fdb3e5 | ||
![]() |
b175d611bd |
@ -20,6 +20,17 @@
|
||||
-->
|
||||
## Release Notes for Cordova (Android) ##
|
||||
|
||||
### 6.2.3 (May 2, 2017)
|
||||
* [CB-12640](https://issues.apache.org/jira/browse/CB-12640) better handling of unrecognized Android SDK commands on **Windows**.
|
||||
* [CB-12640](https://issues.apache.org/jira/browse/CB-12640) flipped avd parsing logic so that it always tries to use avdmanager to retrieve avds first, then falls back to android command if avdmanager cannot be found (and errors with ENOENT). updated tests - and added explicit tests to ensure to shell out to singular forms of sub-commands when executing `android`
|
||||
* [CB-12640](https://issues.apache.org/jira/browse/CB-12640) support for android sdk tools 26.0.1.
|
||||
|
||||
### 6.2.2 (Apr 24, 2017)
|
||||
* [CB-12697](https://issues.apache.org/jira/browse/CB-12697) Updated checked-in `node_modules`
|
||||
|
||||
### 6.2.1 (Apr 02, 2017)
|
||||
* [CB-12621](https://issues.apache.org/jira/browse/CB-12621) reverted elementtree dep to 0.1.6
|
||||
|
||||
### 6.2.0 (Mar 28, 2017)
|
||||
* [CB-12614](https://issues.apache.org/jira/browse/CB-12614) Adding headers to tests
|
||||
* [CB-8978](https://issues.apache.org/jira/browse/CB-8978) Prepare copy `resource-files` from `config.xml`
|
||||
|
77
bin/templates/cordova/lib/android_sdk.js
vendored
77
bin/templates/cordova/lib/android_sdk.js
vendored
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
@ -68,65 +66,38 @@ module.exports.version_string_to_api_level = {
|
||||
'7.1.1': 25
|
||||
};
|
||||
|
||||
module.exports.list_targets_with_android = function() {
|
||||
return superspawn.spawn('android', ['list', 'targets'])
|
||||
.then(function(stdout) {
|
||||
var target_out = stdout.split('\n');
|
||||
var targets = [];
|
||||
for (var i = target_out.length - 1; i >= 0; i--) {
|
||||
if(target_out[i].match(/id:/)) {
|
||||
targets.push(target_out[i].match(/"(.+)"/)[1]);
|
||||
}
|
||||
function parse_targets(output) {
|
||||
var target_out = output.split('\n');
|
||||
var targets = [];
|
||||
for (var i = target_out.length - 1; i >= 0; i--) {
|
||||
if(target_out[i].match(/id:/)) { // if "id:" is in the line...
|
||||
targets.push(target_out[i].match(/"(.+)"/)[1]); //.. match whatever is in quotes.
|
||||
}
|
||||
return targets;
|
||||
});
|
||||
}
|
||||
return targets;
|
||||
}
|
||||
|
||||
module.exports.list_targets_with_android = function() {
|
||||
return superspawn.spawn('android', ['list', 'target'])
|
||||
.then(parse_targets);
|
||||
};
|
||||
|
||||
module.exports.list_targets_with_sdkmanager = function() {
|
||||
return superspawn.spawn('sdkmanager', ['--list'])
|
||||
.then(function(stdout) {
|
||||
var parsing_installed_packages = false;
|
||||
var lines = stdout.split('\n');
|
||||
var targets = [];
|
||||
for (var i = 0, l = lines.length; i < l; i++) {
|
||||
var line = lines[i];
|
||||
if (line.match(/Installed packages/)) {
|
||||
parsing_installed_packages = true;
|
||||
} else if (line.match(/Available Packages/) || line.match(/Available Updates/)) {
|
||||
// we are done working through installed packages, exit
|
||||
break;
|
||||
}
|
||||
if (parsing_installed_packages) {
|
||||
// Match stock android platform
|
||||
if (line.match(/platforms;android-\d+/)) {
|
||||
targets.push(line.match(/(android-\d+)/)[1]);
|
||||
}
|
||||
// Match Google APIs
|
||||
if (line.match(/addon-google_apis-google-\d+/)) {
|
||||
var description = lines[i + 1];
|
||||
// munge description to match output from old android sdk tooling
|
||||
var api_level = description.match(/Android (\d+)/); //[1];
|
||||
if (api_level) {
|
||||
targets.push('Google Inc.:Google APIs:' + api_level[1]);
|
||||
}
|
||||
}
|
||||
// TODO: match anything else?
|
||||
}
|
||||
}
|
||||
return targets;
|
||||
});
|
||||
module.exports.list_targets_with_avdmanager = function() {
|
||||
return superspawn.spawn('avdmanager', ['list', 'target'])
|
||||
.then(parse_targets);
|
||||
};
|
||||
|
||||
module.exports.list_targets = function() {
|
||||
return module.exports.list_targets_with_android()
|
||||
return module.exports.list_targets_with_avdmanager()
|
||||
.catch(function(err) {
|
||||
// there's a chance `android` no longer works.
|
||||
// lets see if `sdkmanager` is available and we can figure it out
|
||||
var avail_regex = /"?android"? command is no longer available/;
|
||||
if (err.code && ((err.stdout && err.stdout.match(avail_regex)) || (err.stderr && err.stderr.match(avail_regex)))) {
|
||||
return module.exports.list_targets_with_sdkmanager();
|
||||
// If there's an error, like avdmanager could not be found, we can try
|
||||
// as a last resort, to run `android`, in case this is a super old
|
||||
// SDK installation.
|
||||
if (err && (err.code == 'ENOENT' || (err.stderr && err.stderr.match(/not recognized/)))) {
|
||||
return module.exports.list_targets_with_android();
|
||||
} else throw err;
|
||||
}).then(function(targets) {
|
||||
})
|
||||
.then(function(targets) {
|
||||
if (targets.length === 0) {
|
||||
return Q.reject(new Error('No android targets (SDKs) installed!'));
|
||||
}
|
||||
|
20
bin/templates/cordova/lib/emulator.js
vendored
20
bin/templates/cordova/lib/emulator.js
vendored
@ -116,7 +116,7 @@ module.exports.list_images_using_avdmanager = function () {
|
||||
};
|
||||
|
||||
module.exports.list_images_using_android = function() {
|
||||
return superspawn.spawn('android', ['list', 'avds'])
|
||||
return superspawn.spawn('android', ['list', 'avd'])
|
||||
.then(function(output) {
|
||||
var response = output.split('\n');
|
||||
var emulator_list = [];
|
||||
@ -171,20 +171,10 @@ module.exports.list_images_using_android = function() {
|
||||
}
|
||||
*/
|
||||
module.exports.list_images = function() {
|
||||
if (forgivingWhichSync('android')) {
|
||||
return module.exports.list_images_using_android()
|
||||
.catch(function(err) {
|
||||
// try to use `avdmanager` in case `android` reports it is no longer available.
|
||||
// this likely means the target machine is using a newer version of
|
||||
// the android sdk, and possibly `avdmanager` is available.
|
||||
if (err.code == 1 && err.stdout.indexOf('android command is no longer available')) {
|
||||
return module.exports.list_images_using_avdmanager();
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
} else if (forgivingWhichSync('avdmanager')) {
|
||||
if (forgivingWhichSync('avdmanager')) {
|
||||
return module.exports.list_images_using_avdmanager();
|
||||
} else if (forgivingWhichSync('android')) {
|
||||
return module.exports.list_images_using_android();
|
||||
} else {
|
||||
return Q().then(function() {
|
||||
throw new CordovaError('Could not find either `android` or `avdmanager` on your $PATH! Are you sure the Android SDK is installed and available?');
|
||||
@ -228,6 +218,7 @@ module.exports.list_started = function() {
|
||||
};
|
||||
|
||||
// Returns a promise.
|
||||
// TODO: we should remove this, there's a more robust method under android_sdk.js
|
||||
module.exports.list_targets = function() {
|
||||
return superspawn.spawn('android', ['list', 'targets'], {cwd: os.tmpdir()})
|
||||
.then(function(output) {
|
||||
@ -399,6 +390,7 @@ module.exports.create_image = function(name, target) {
|
||||
});
|
||||
} else {
|
||||
console.log('WARNING : Project target not found, creating avd with a different target but the project may fail to install.');
|
||||
// TODO: there's a more robust method for finding targets in android_sdk.js
|
||||
return superspawn.spawn('android', ['create', 'avd', '--name', name, '--target', this.list_targets()[0]])
|
||||
.then(function() {
|
||||
// TODO: This seems like another error case, even though it always happens.
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
// Coho updates this line:
|
||||
var VERSION = "6.2.0-dev";
|
||||
var VERSION = "6.2.3";
|
||||
|
||||
module.exports.version = VERSION;
|
||||
|
||||
|
14
bin/templates/project/assets/www/cordova.js
vendored
14
bin/templates/project/assets/www/cordova.js
vendored
@ -1,5 +1,5 @@
|
||||
// Platform: android
|
||||
// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20
|
||||
// 7ef9f9c03167a4dde4372d869472241b6816fee9
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
@ -19,7 +19,7 @@
|
||||
under the License.
|
||||
*/
|
||||
;(function() {
|
||||
var PLATFORM_VERSION_BUILD_LABEL = '6.2.0-dev';
|
||||
var PLATFORM_VERSION_BUILD_LABEL = '6.2.3';
|
||||
// file: src/scripts/require.js
|
||||
|
||||
/*jshint -W079 */
|
||||
@ -330,7 +330,7 @@ module.exports = cordova;
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
||||
// file: /Users/maj/src/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
||||
define("cordova/android/nativeapiprovider", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@ -353,7 +353,7 @@ module.exports = {
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
||||
// file: /Users/maj/src/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
||||
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@ -886,7 +886,7 @@ module.exports = channel;
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/exec.js
|
||||
// file: /Users/maj/src/cordova-android/cordova-js-src/exec.js
|
||||
define("cordova/exec", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@ -1649,7 +1649,7 @@ exports.reset();
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js
|
||||
// file: /Users/maj/src/cordova-android/cordova-js-src/platform.js
|
||||
define("cordova/platform", function(require, exports, module) {
|
||||
|
||||
// The last resume event that was received that had the result of a plugin call.
|
||||
@ -1759,7 +1759,7 @@ function onMessageFromNative(msg) {
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js
|
||||
// file: /Users/maj/src/cordova-android/cordova-js-src/plugin/android/app.js
|
||||
define("cordova/plugin/android/app", function(require, exports, module) {
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
|
@ -40,7 +40,7 @@ apply plugin: 'com.github.dcendents.android-maven'
|
||||
apply plugin: 'com.jfrog.bintray'
|
||||
|
||||
group = 'org.apache.cordova'
|
||||
version = '6.2.0'
|
||||
version = '6.2.3'
|
||||
|
||||
android {
|
||||
compileSdkVersion cdvCompileSdkVersion
|
||||
@ -127,9 +127,9 @@ bintray {
|
||||
licenses = ['Apache-2.0']
|
||||
labels = ['android', 'cordova', 'phonegap']
|
||||
version {
|
||||
name = '6.2.0'
|
||||
name = '6.2.3'
|
||||
released = new Date()
|
||||
vcsTag = '6.2.0'
|
||||
vcsTag = '6.2.3'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback;
|
||||
* are not expected to implement it.
|
||||
*/
|
||||
public interface CordovaWebView {
|
||||
public static final String CORDOVA_VERSION = "6.2.0-dev";
|
||||
public static final String CORDOVA_VERSION = "6.2.3";
|
||||
|
||||
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);
|
||||
|
||||
|
@ -210,6 +210,11 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
|
||||
settings.setAppCachePath(databasePath);
|
||||
settings.setAppCacheEnabled(true);
|
||||
|
||||
// Enable scaling
|
||||
// Fix for CB-12015
|
||||
settings.setUseWideViewPort(true);
|
||||
settings.setLoadWithOverviewMode(true);
|
||||
|
||||
// Fix for CB-1405
|
||||
// Google issue 4641
|
||||
String defaultUserAgent = settings.getUserAgentString();
|
||||
|
56
node_modules/big-integer/BigInteger.js
generated
vendored
56
node_modules/big-integer/BigInteger.js
generated
vendored
@ -118,7 +118,7 @@ var bigInt = (function (undefined) {
|
||||
}
|
||||
|
||||
BigInteger.prototype.add = function (v) {
|
||||
var value, n = parseValue(v);
|
||||
var n = parseValue(v);
|
||||
if (this.sign !== n.sign) {
|
||||
return this.subtract(n.negate());
|
||||
}
|
||||
@ -177,7 +177,7 @@ var bigInt = (function (undefined) {
|
||||
}
|
||||
|
||||
function subtractAny(a, b, sign) {
|
||||
var value, isSmall;
|
||||
var value;
|
||||
if (compareAbs(a, b) >= 0) {
|
||||
value = subtract(a,b);
|
||||
} else {
|
||||
@ -326,7 +326,7 @@ var bigInt = (function (undefined) {
|
||||
}
|
||||
|
||||
BigInteger.prototype.multiply = function (v) {
|
||||
var value, n = parseValue(v),
|
||||
var n = parseValue(v),
|
||||
a = this.value, b = n.value,
|
||||
sign = this.sign !== n.sign,
|
||||
abs;
|
||||
@ -467,6 +467,7 @@ var bigInt = (function (undefined) {
|
||||
guess, xlen, highx, highy, check;
|
||||
while (a_l) {
|
||||
part.unshift(a[--a_l]);
|
||||
trim(part);
|
||||
if (compareAbs(part, b) < 0) {
|
||||
result.push(0);
|
||||
continue;
|
||||
@ -825,20 +826,24 @@ var bigInt = (function (undefined) {
|
||||
BigInteger.prototype.modInv = function (n) {
|
||||
var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;
|
||||
while (!newR.equals(bigInt.zero)) {
|
||||
q = r.divide(newR);
|
||||
lastT = t;
|
||||
lastR = r;
|
||||
t = newT;
|
||||
r = newR;
|
||||
newT = lastT.subtract(q.multiply(newT));
|
||||
newR = lastR.subtract(q.multiply(newR));
|
||||
q = r.divide(newR);
|
||||
lastT = t;
|
||||
lastR = r;
|
||||
t = newT;
|
||||
r = newR;
|
||||
newT = lastT.subtract(q.multiply(newT));
|
||||
newR = lastR.subtract(q.multiply(newR));
|
||||
}
|
||||
if (!r.equals(1)) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
|
||||
if (t.compare(0) === -1) {
|
||||
t = t.add(n);
|
||||
t = t.add(n);
|
||||
}
|
||||
if (this.isNegative()) {
|
||||
return t.negate();
|
||||
}
|
||||
return t;
|
||||
}
|
||||
};
|
||||
|
||||
SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
|
||||
|
||||
BigInteger.prototype.next = function () {
|
||||
@ -977,7 +982,7 @@ var bigInt = (function (undefined) {
|
||||
b = parseValue(b);
|
||||
return a.greater(b) ? a : b;
|
||||
}
|
||||
function min(a,b) {
|
||||
function min(a, b) {
|
||||
a = parseValue(a);
|
||||
b = parseValue(b);
|
||||
return a.lesser(b) ? a : b;
|
||||
@ -1032,8 +1037,7 @@ var bigInt = (function (undefined) {
|
||||
return low.add(typeof result === "number" ? new SmallInteger(result) : new BigInteger(result, false));
|
||||
}
|
||||
var parseBase = function (text, base) {
|
||||
var val = Integer[0], pow = Integer[1],
|
||||
length = text.length;
|
||||
var length = text.length;
|
||||
if (2 <= base && base <= 36) {
|
||||
if (length <= LOG_MAX_INT / Math.log(base)) {
|
||||
return new SmallInteger(parseInt(text, base));
|
||||
@ -1055,13 +1059,17 @@ var bigInt = (function (undefined) {
|
||||
}
|
||||
else throw new Error(c + " is not a valid character");
|
||||
}
|
||||
digits.reverse();
|
||||
for (i = 0; i < digits.length; i++) {
|
||||
return parseBaseFromArray(digits, base, isNegative);
|
||||
};
|
||||
|
||||
function parseBaseFromArray(digits, base, isNegative) {
|
||||
var val = Integer[0], pow = Integer[1], i;
|
||||
for (i = digits.length - 1; i >= 0; i--) {
|
||||
val = val.add(digits[i].times(pow));
|
||||
pow = pow.times(base);
|
||||
}
|
||||
return isNegative ? val.negate() : val;
|
||||
};
|
||||
}
|
||||
|
||||
function stringify(digit) {
|
||||
var v = digit.value;
|
||||
@ -1205,6 +1213,11 @@ var bigInt = (function (undefined) {
|
||||
Integer.lcm = lcm;
|
||||
Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger; };
|
||||
Integer.randBetween = randBetween;
|
||||
|
||||
Integer.fromArray = function (digits, base, isNegative) {
|
||||
return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);
|
||||
};
|
||||
|
||||
return Integer;
|
||||
})();
|
||||
|
||||
@ -1212,3 +1225,10 @@ var bigInt = (function (undefined) {
|
||||
if (typeof module !== "undefined" && module.hasOwnProperty("exports")) {
|
||||
module.exports = bigInt;
|
||||
}
|
||||
|
||||
//amd check
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
define( "big-integer", [], function() {
|
||||
return bigInt;
|
||||
});
|
||||
}
|
||||
|
2
node_modules/big-integer/BigInteger.min.js
generated
vendored
2
node_modules/big-integer/BigInteger.min.js
generated
vendored
File diff suppressed because one or more lines are too long
7
node_modules/big-integer/README.md
generated
vendored
7
node_modules/big-integer/README.md
generated
vendored
@ -421,6 +421,13 @@ Performs the bitwise XOR operation. The operands are treated as if they were rep
|
||||
|
||||
### Static Methods
|
||||
|
||||
#### `fromArray(digits, base = 10, isNegative?)`
|
||||
|
||||
Constructs a bigInt from an array of digits in base `base`. The optional `isNegative` flag will make the number negative.
|
||||
|
||||
- `bigInt.fromArray([1, 2, 3, 4, 5], 10)` => `12345`
|
||||
- `bigInt.fromArray([1, 0, 0], 2, true)` => `-4`
|
||||
|
||||
#### `gcd(a, b)`
|
||||
|
||||
Finds the greatest common denominator of `a` and `b`.
|
||||
|
24
node_modules/big-integer/package.json
generated
vendored
24
node_modules/big-integer/package.json
generated
vendored
@ -14,19 +14,19 @@
|
||||
]
|
||||
],
|
||||
"_from": "big-integer@>=1.6.7 <2.0.0",
|
||||
"_id": "big-integer@1.6.17",
|
||||
"_id": "big-integer@1.6.22",
|
||||
"_inCache": true,
|
||||
"_location": "/big-integer",
|
||||
"_nodeVersion": "4.4.5",
|
||||
"_nodeVersion": "6.9.4",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/big-integer-1.6.17.tgz_1478721202721_0.8068355675786734"
|
||||
"tmp": "tmp/big-integer-1.6.22.tgz_1493091323169_0.5048394540790468"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "peterolson",
|
||||
"email": "peter.e.c.olson+npm@gmail.com"
|
||||
},
|
||||
"_npmVersion": "2.15.5",
|
||||
"_npmVersion": "3.10.10",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "big-integer@^1.6.7",
|
||||
@ -40,8 +40,8 @@
|
||||
"_requiredBy": [
|
||||
"/bplist-parser"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/big-integer/-/big-integer-1.6.17.tgz",
|
||||
"_shasum": "f0dcf5109a949e42a993ee3e8fb2070452817b51",
|
||||
"_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.22.tgz",
|
||||
"_shasum": "487c95fce886022ea48ff5f19e388932df46dd2e",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "big-integer@^1.6.7",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/bplist-parser",
|
||||
@ -63,17 +63,18 @@
|
||||
"karma": "^0.13.3",
|
||||
"karma-coverage": "^0.4.2",
|
||||
"karma-jasmine": "^0.3.6",
|
||||
"karma-phantomjs-launcher": "~0.1"
|
||||
"karma-phantomjs-launcher": "~0.1",
|
||||
"uglifyjs": "^2.4.10"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "f0dcf5109a949e42a993ee3e8fb2070452817b51",
|
||||
"tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.17.tgz"
|
||||
"shasum": "487c95fce886022ea48ff5f19e388932df46dd2e",
|
||||
"tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.22.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"gitHead": "d25d0bfcd96f31001ec8572c8d01de4770d99e63",
|
||||
"gitHead": "40483b881b4380931e5af6f2f8a161b6caa71690",
|
||||
"homepage": "https://github.com/peterolson/BigInteger.js#readme",
|
||||
"keywords": [
|
||||
"math",
|
||||
@ -102,7 +103,8 @@
|
||||
"url": "git+ssh://git@github.com/peterolson/BigInteger.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"minify": "uglifyjs BigInteger.js -o BigInteger.min.js",
|
||||
"test": "karma start my.conf.js"
|
||||
},
|
||||
"version": "1.6.17"
|
||||
"version": "1.6.22"
|
||||
}
|
||||
|
1
node_modules/brace-expansion/README.md
generated
vendored
1
node_modules/brace-expansion/README.md
generated
vendored
@ -5,6 +5,7 @@ as known from sh/bash, in JavaScript.
|
||||
|
||||
[](http://travis-ci.org/juliangruber/brace-expansion)
|
||||
[](https://www.npmjs.org/package/brace-expansion)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
[](https://ci.testling.com/juliangruber/brace-expansion)
|
||||
|
||||
|
2
node_modules/brace-expansion/index.js
generated
vendored
2
node_modules/brace-expansion/index.js
generated
vendored
@ -106,7 +106,7 @@ function expand(str, isTop) {
|
||||
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isSequence = isNumericSequence || isAlphaSequence;
|
||||
var isOptions = /^(.*,)+(.+)?$/.test(m.body);
|
||||
var isOptions = m.body.indexOf(',') >= 0;
|
||||
if (!isSequence && !isOptions) {
|
||||
// {a},b}
|
||||
if (m.post.match(/,.*\}/)) {
|
||||
|
24
node_modules/brace-expansion/package.json
generated
vendored
24
node_modules/brace-expansion/package.json
generated
vendored
@ -14,19 +14,19 @@
|
||||
]
|
||||
],
|
||||
"_from": "brace-expansion@>=1.0.0 <2.0.0",
|
||||
"_id": "brace-expansion@1.1.6",
|
||||
"_id": "brace-expansion@1.1.7",
|
||||
"_inCache": true,
|
||||
"_location": "/brace-expansion",
|
||||
"_nodeVersion": "4.4.7",
|
||||
"_nodeVersion": "7.8.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-16-east.internal.npmjs.com",
|
||||
"tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428"
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/brace-expansion-1.1.7.tgz_1491552830231_0.7213963181711733"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "juliangruber",
|
||||
"email": "julian@juliangruber.com"
|
||||
},
|
||||
"_npmVersion": "2.15.8",
|
||||
"_npmVersion": "4.2.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "brace-expansion@^1.0.0",
|
||||
@ -40,8 +40,8 @@
|
||||
"_requiredBy": [
|
||||
"/minimatch"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz",
|
||||
"_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9",
|
||||
"_resolved": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz",
|
||||
"_shasum": "3effc3c50e000531fb720eaff80f0ae8ef23cf59",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "brace-expansion@^1.0.0",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/minimatch",
|
||||
@ -59,14 +59,15 @@
|
||||
},
|
||||
"description": "Brace expansion as known from sh/bash",
|
||||
"devDependencies": {
|
||||
"matcha": "^0.7.0",
|
||||
"tape": "^4.6.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9",
|
||||
"tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz"
|
||||
"shasum": "3effc3c50e000531fb720eaff80f0ae8ef23cf59",
|
||||
"tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz"
|
||||
},
|
||||
"gitHead": "791262fa06625e9c5594cde529a21d82086af5f2",
|
||||
"gitHead": "892512024872ca7680554be90f6e8ce065053372",
|
||||
"homepage": "https://github.com/juliangruber/brace-expansion",
|
||||
"keywords": [],
|
||||
"license": "MIT",
|
||||
@ -89,6 +90,7 @@
|
||||
"url": "git://github.com/juliangruber/brace-expansion.git"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "matcha test/perf/bench.js",
|
||||
"gentest": "bash test/generate.sh",
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
@ -108,5 +110,5 @@
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
},
|
||||
"version": "1.1.6"
|
||||
"version": "1.1.7"
|
||||
}
|
||||
|
7
node_modules/cordova-common/RELEASENOTES.md
generated
vendored
7
node_modules/cordova-common/RELEASENOTES.md
generated
vendored
@ -20,6 +20,13 @@
|
||||
-->
|
||||
# Cordova-common Release Notes
|
||||
|
||||
### 2.0.2 (Apr 14, 2017)
|
||||
* [CB-11233](https://issues.apache.org/jira/browse/CB-11233) - Support installing frameworks into 'Embedded Binaries' section of the Xcode project
|
||||
* [CB-10438](https://issues.apache.org/jira/browse/CB-10438) - Install correct dependency version. Removed shell.remove, added pkg.json to dependency tests 1-3, and updated install.js (.replace) to fix tests in uninstall.spec.js and update to workw with jasmine 2.0
|
||||
* [CB-11120](https://issues.apache.org/jira/browse/CB-11120) - Allow short/display name in config.xml
|
||||
* [CB-11346](https://issues.apache.org/jira/browse/CB-11346) - Remove known platforms check
|
||||
* [CB-11977](https://issues.apache.org/jira/browse/CB-11977) - updated engines and enginescript for common, fetch, and serve
|
||||
|
||||
### 2.0.1 (Mar 09, 2017)
|
||||
* [CB-12557](https://issues.apache.org/jira/browse/CB-12557) add both stdout and stderr properties to the error object passed to superspawn reject handler.
|
||||
|
||||
|
27
node_modules/cordova-common/package.json
generated
vendored
27
node_modules/cordova-common/package.json
generated
vendored
@ -14,19 +14,19 @@
|
||||
]
|
||||
],
|
||||
"_from": "cordova-common@>=2.0.1 <3.0.0",
|
||||
"_id": "cordova-common@2.0.1",
|
||||
"_id": "cordova-common@2.0.2",
|
||||
"_inCache": true,
|
||||
"_location": "/cordova-common",
|
||||
"_nodeVersion": "6.9.4",
|
||||
"_nodeVersion": "4.7.3",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-18-east.internal.npmjs.com",
|
||||
"tmp": "tmp/cordova-common-2.0.1.tgz_1489432932737_0.5238456283695996"
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/cordova-common-2.0.2.tgz_1492453798445_0.6290795875247568"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "filmaj",
|
||||
"email": "maj.fil@gmail.com"
|
||||
"name": "shazron",
|
||||
"email": "shazron@gmail.com"
|
||||
},
|
||||
"_npmVersion": "3.10.10",
|
||||
"_npmVersion": "2.15.11",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "cordova-common@^2.0.1",
|
||||
@ -40,8 +40,8 @@
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/cordova-common/-/cordova-common-2.0.1.tgz",
|
||||
"_shasum": "99af318d7cb8988047cfe37bb9f25ea881d52815",
|
||||
"_resolved": "http://registry.npmjs.org/cordova-common/-/cordova-common-2.0.2.tgz",
|
||||
"_shasum": "57467976b8afd5e0bd0a13111b66a420441601cb",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "cordova-common@^2.0.1",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android",
|
||||
@ -78,11 +78,12 @@
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "99af318d7cb8988047cfe37bb9f25ea881d52815",
|
||||
"tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.0.1.tgz"
|
||||
"shasum": "57467976b8afd5e0bd0a13111b66a420441601cb",
|
||||
"tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.0.2.tgz"
|
||||
},
|
||||
"engineStrict": true,
|
||||
"engines": {
|
||||
"node": ">=0.9.9"
|
||||
"node": ">=4.0.0"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"main": "cordova-common.js",
|
||||
@ -129,5 +130,5 @@
|
||||
"jshint": "jshint src && jshint spec",
|
||||
"test": "npm run jshint && npm run jasmine"
|
||||
},
|
||||
"version": "2.0.1"
|
||||
"version": "2.0.2"
|
||||
}
|
||||
|
10
node_modules/cordova-common/src/ConfigParser/ConfigParser.js
generated
vendored
10
node_modules/cordova-common/src/ConfigParser/ConfigParser.js
generated
vendored
@ -116,6 +116,16 @@ ConfigParser.prototype = {
|
||||
var el = findOrCreate(this.doc, 'name');
|
||||
el.text = name;
|
||||
},
|
||||
shortName: function() {
|
||||
return this.doc.find('name').attrib['short'] || this.name();
|
||||
},
|
||||
setShortName: function(shortname) {
|
||||
var el = findOrCreate(this.doc, 'name');
|
||||
if (!el.text) {
|
||||
el.text = shortname;
|
||||
}
|
||||
el.attrib['short'] = shortname;
|
||||
},
|
||||
description: function() {
|
||||
return getNodeTextSafe(this.doc.find('description'));
|
||||
},
|
||||
|
2
node_modules/cordova-common/src/PluginInfo/PluginInfo.js
generated
vendored
2
node_modules/cordova-common/src/PluginInfo/PluginInfo.js
generated
vendored
@ -108,6 +108,7 @@ function PluginInfo(dirname) {
|
||||
function _parseDependency(tag) {
|
||||
var dep =
|
||||
{ id : tag.attrib.id
|
||||
, version: tag.attrib.version || ''
|
||||
, url : tag.attrib.url || ''
|
||||
, subdir : tag.attrib.subdir || ''
|
||||
, commit : tag.attrib.commit
|
||||
@ -318,6 +319,7 @@ function PluginInfo(dirname) {
|
||||
type: el.attrib.type,
|
||||
parent: el.attrib.parent,
|
||||
custom: isStrTrue(el.attrib.custom),
|
||||
embed: isStrTrue(el.attrib.embed),
|
||||
src: el.attrib.src,
|
||||
spec: el.attrib.spec,
|
||||
weak: isStrTrue(el.attrib.weak),
|
||||
|
1
node_modules/cordova-common/src/events.js
generated
vendored
1
node_modules/cordova-common/src/events.js
generated
vendored
@ -20,6 +20,7 @@
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
|
||||
var INSTANCE = new EventEmitter();
|
||||
INSTANCE.setMaxListeners(20);
|
||||
var EVENTS_RECEIVER;
|
||||
|
||||
module.exports = INSTANCE;
|
||||
|
6
node_modules/elementtree/.travis.yml
generated
vendored
6
node_modules/elementtree/.travis.yml
generated
vendored
@ -1,11 +1,7 @@
|
||||
language: node_js
|
||||
sudo: false
|
||||
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "0.11"
|
||||
- "0.12"
|
||||
- "iojs"
|
||||
- 0.6
|
||||
|
||||
script: make test
|
||||
|
||||
|
2
node_modules/elementtree/CHANGES.md
generated
vendored
2
node_modules/elementtree/CHANGES.md
generated
vendored
@ -1,4 +1,4 @@
|
||||
elementtree v0.1.6 - 2014-02-06
|
||||
elementtree v0.1.6 (in development)
|
||||
|
||||
* Add support for CData elements. (#14)
|
||||
[hermannpencole]
|
||||
|
73
node_modules/elementtree/package.json
generated
vendored
73
node_modules/elementtree/package.json
generated
vendored
@ -2,49 +2,44 @@
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "elementtree@^0.1.6",
|
||||
"raw": "elementtree@0.1.6",
|
||||
"scope": null,
|
||||
"escapedName": "elementtree",
|
||||
"name": "elementtree",
|
||||
"rawSpec": "^0.1.6",
|
||||
"spec": ">=0.1.6 <0.2.0",
|
||||
"type": "range"
|
||||
"rawSpec": "0.1.6",
|
||||
"spec": "0.1.6",
|
||||
"type": "version"
|
||||
},
|
||||
"/Users/steveng/repo/cordova/cordova-android"
|
||||
]
|
||||
],
|
||||
"_from": "elementtree@>=0.1.6 <0.2.0",
|
||||
"_id": "elementtree@0.1.7",
|
||||
"_from": "elementtree@0.1.6",
|
||||
"_id": "elementtree@0.1.6",
|
||||
"_inCache": true,
|
||||
"_location": "/elementtree",
|
||||
"_nodeVersion": "4.5.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/elementtree-0.1.7.tgz_1485230431723_0.19623595383018255"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "mburns",
|
||||
"email": "michael@mirwin.net"
|
||||
"name": "rphillips",
|
||||
"email": "ryan@trolocsis.com"
|
||||
},
|
||||
"_npmVersion": "2.15.9",
|
||||
"_npmVersion": "1.3.24",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "elementtree@^0.1.6",
|
||||
"raw": "elementtree@0.1.6",
|
||||
"scope": null,
|
||||
"escapedName": "elementtree",
|
||||
"name": "elementtree",
|
||||
"rawSpec": "^0.1.6",
|
||||
"spec": ">=0.1.6 <0.2.0",
|
||||
"type": "range"
|
||||
"rawSpec": "0.1.6",
|
||||
"spec": "0.1.6",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/",
|
||||
"/cordova-common"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/elementtree/-/elementtree-0.1.7.tgz",
|
||||
"_shasum": "9ac91be6e52fb6e6244c4e54a4ac3ed8ae8e29c0",
|
||||
"_resolved": "http://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz",
|
||||
"_shasum": "2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "elementtree@^0.1.6",
|
||||
"_spec": "elementtree@0.1.6",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android",
|
||||
"author": {
|
||||
"name": "Rackspace US, Inc."
|
||||
@ -63,7 +58,7 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"sax": "1.1.4"
|
||||
"sax": "0.3.5"
|
||||
},
|
||||
"description": "XML Serialization and Parsing module based on Python's ElementTree.",
|
||||
"devDependencies": {
|
||||
@ -73,13 +68,12 @@
|
||||
"lib": "lib"
|
||||
},
|
||||
"dist": {
|
||||
"shasum": "9ac91be6e52fb6e6244c4e54a4ac3ed8ae8e29c0",
|
||||
"tarball": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.7.tgz"
|
||||
"shasum": "2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c",
|
||||
"tarball": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
},
|
||||
"gitHead": "1e9496379f6a1072e2b817f51a296f7cd9f07e43",
|
||||
"homepage": "https://github.com/racker/node-elementtree",
|
||||
"keywords": [
|
||||
"xml",
|
||||
@ -88,29 +82,14 @@
|
||||
"seralization",
|
||||
"elementtree"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"licenses": [
|
||||
{
|
||||
"type": "Apache",
|
||||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||||
}
|
||||
],
|
||||
"main": "lib/elementtree.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "jirwin",
|
||||
"email": "justin.gallardo@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "kami",
|
||||
"email": "tomaz+npm@tomaz.me"
|
||||
},
|
||||
{
|
||||
"name": "mburns",
|
||||
"email": "michael@mirwin.net"
|
||||
},
|
||||
{
|
||||
"name": "pquerna",
|
||||
"email": "pquerna@apache.org"
|
||||
},
|
||||
{
|
||||
"name": "rchiniquy",
|
||||
"email": "robert.chiniquy@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "rphillips",
|
||||
"email": "ryan@trolocsis.com"
|
||||
@ -126,5 +105,5 @@
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"version": "0.1.7"
|
||||
"version": "0.1.6"
|
||||
}
|
||||
|
17
node_modules/elementtree/tests/data/bom-xml.xml
generated
vendored
17
node_modules/elementtree/tests/data/bom-xml.xml
generated
vendored
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<container name="test_container_1" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<object>dd
|
||||
<name>test_object_1</name>
|
||||
<hash>4281c348eaf83e70ddce0e07221c3d28</hash>
|
||||
<bytes android:type="cool">14</bytes>
|
||||
<content_type>application/octetstream</content_type>
|
||||
<last_modified>2009-02-03T05:26:32.612278</last_modified>
|
||||
</object>
|
||||
<object>
|
||||
<name>test_object_2</name>
|
||||
<hash>b039efe731ad111bc1b0ef221c3849d0</hash>
|
||||
<bytes android:type="lame">64</bytes>
|
||||
<content_type>application/octetstream</content_type>
|
||||
<last_modified>2009-02-03T05:26:32.612278</last_modified>
|
||||
</object>
|
||||
</container>
|
9
node_modules/elementtree/tests/test-simple.js
generated
vendored
9
node_modules/elementtree/tests/test-simple.js
generated
vendored
@ -337,12 +337,3 @@ exports['test_cdata_write'] = function(test, assert) {
|
||||
|
||||
test.finish();
|
||||
};
|
||||
|
||||
exports['test_read_bom'] = function(test, assert) {
|
||||
var file = readFile('bom-xml.xml');
|
||||
var etree = et.parse(file);
|
||||
|
||||
// If parse finished, test was successful
|
||||
|
||||
test.finish();
|
||||
};
|
||||
|
9
node_modules/sax/AUTHORS
generated
vendored
Normal file
9
node_modules/sax/AUTHORS
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
# contributors sorted by whether or not they're me.
|
||||
Isaac Z. Schlueter <i@izs.me>
|
||||
Stein Martin Hustad <stein@hustad.com>
|
||||
Mikeal Rogers <mikeal.rogers@gmail.com>
|
||||
Laurie Harper <laurie@holoweb.net>
|
||||
Jann Horn <jann@Jann-PC.fritz.box>
|
||||
Elijah Insua <tmpvar@gmail.com>
|
||||
Henry Rawas <henryr@schakra.com>
|
||||
Justin Makeig <jmpublic@makeig.com>
|
58
node_modules/sax/LICENSE
generated
vendored
58
node_modules/sax/LICENSE
generated
vendored
@ -1,41 +1,23 @@
|
||||
The ISC License
|
||||
Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
|
||||
All rights reserved.
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
====
|
||||
|
||||
`String.fromCodePoint` by Mathias Bynens used according to terms of MIT
|
||||
License, as follows:
|
||||
|
||||
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
188
node_modules/sax/LICENSE-W3C.html
generated
vendored
188
node_modules/sax/LICENSE-W3C.html
generated
vendored
@ -1,188 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="generator" content="HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 13), see www.w3.org" /><title>W3C Software Notice and License</title><link rel="stylesheet" href="/2008/site/css/minimum" type="text/css" media="handheld, all" /><style type="text/css" media="print, screen and (min-width: 481px)" xml:space="preserve">
|
||||
@import url("/2008/site/css/advanced");
|
||||
</style><link href="/2008/site/css/minimum" rel="stylesheet" type="text/css" media="handheld, only screen and (max-device-width: 480px)" /><meta name="viewport" content="width=device-width" /><link rel="stylesheet" href="/2008/site/css/print" type="text/css" media="print" /><link rel="shortcut icon" href="/2008/site/images/favicon.ico" type="image/x-icon" /></head><body id="www-w3-org" class="w3c_public"><div id="w3c_container">
|
||||
|
||||
|
||||
|
||||
<div id="w3c_mast">
|
||||
<h1 class="logo">
|
||||
<a tabindex="2" accesskey="1" href="/"><img src="/2008/site/images/logo-w3c-mobile-lg" width="90" height="53" alt="W3C" /></a>
|
||||
<span class="alt-logo">W3C</span>
|
||||
</h1>
|
||||
|
||||
<div id="w3c_nav">
|
||||
|
||||
|
||||
|
||||
<form action="/Help/search" method="get" enctype="application/x-www-form-urlencoded"><div class="w3c_sec_nav"><!-- --></div><ul class="main_nav"><li class="first-item">
|
||||
<a href="/standards/">Standards</a>
|
||||
</li><li>
|
||||
<a href="/participate/">Participate</a>
|
||||
</li><li>
|
||||
<a href="/Consortium/membership">Membership</a>
|
||||
</li><li class="last-item">
|
||||
<a href="/Consortium/">About W3C</a>
|
||||
</li><li class="search-item">
|
||||
<div id="search-form">
|
||||
<input tabindex="3" class="text" name="q" value="" title="Search" type="text" />
|
||||
<button id="search-submit" name="search-submit" type="submit"><img class="submit" src="/2008/site/images/search-button" alt="Search" width="21" height="17" /></button>
|
||||
</div>
|
||||
</li></ul></form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="w3c_main">
|
||||
<div id="w3c_logo_shadow" class="w3c_leftCol">
|
||||
<img height="32" alt="" src="/2008/site/images/logo-shadow" />
|
||||
</div>
|
||||
|
||||
<div class="w3c_leftCol"><h2 class="offscreen">Site Navigation</h2>
|
||||
<h3 class="category"><span class="ribbon"><a href="/Consortium/Legal/ipr-notice.html" title="Up to Policies and Legal Information">Policies and Legal Information <img src="/2008/site/images/header-link" alt="Header link" width="13" height="13" class="header-link" /></a></span></h3>
|
||||
<ul class="theme">
|
||||
<li><a href="/Consortium/Legal/2008/04-testsuite-copyright.html">Licenses for W3C Test Suites</a></li>
|
||||
<li><a href="/2004/10/27-testcases.html">Policies for Contribution of Test Cases to W3C</a></li>
|
||||
<li><a href="/Consortium/Legal/IPR-FAQ-20000620.html">Intellectual Rights FAQ</a></li>
|
||||
<li><a href="/Consortium/Legal/privacy-statement-20000612.html">W3C Privacy Statements</a></li>
|
||||
<li><a href="/Consortium/Legal/2002/copyright-documents-20021231.html">W3C Document License</a></li>
|
||||
<li><a href="/Consortium/Legal/2002/trademarks-20021231.html">W3C Trademarks and Generic Terms</a></li>
|
||||
<li><a href="/Consortium/Legal/2002/trademark-license-20021231.html">W3C® Trademark and Service Mark License</a></li>
|
||||
<li><a class="current">W3C Software Notice and License</a></li>
|
||||
<li><a href="/Consortium/Legal/2002/collaborators-agreement-20021231.html">W3C Invited Expert and Collaborators Agreement</a></li>
|
||||
<li><a href="/Consortium/Persistence.html">W3C URI Persistence Policy</a></li>
|
||||
<li><a href="/1999/10/21-mirroring-policy.html">Mirroring the W3C Site</a></li>
|
||||
<li><a href="/Consortium/Legal/2006/08-copyright-translations.html">Translations of the Copyright Notice</a></li>
|
||||
</ul>
|
||||
<br /></div>
|
||||
<div class="w3c_mainCol">
|
||||
<div id="w3c_crumbs">
|
||||
<div id="w3c_crumbs_frame">
|
||||
<ul class="bct"> <!-- .bct / Breadcrumbs -->
|
||||
<li class="skip"><a tabindex="1" accesskey="2" title="Skip to content (e.g., when browsing via audio)" href="#w3c_content_body">Skip</a></li>
|
||||
<li><a href="/">W3C</a> <span class="cr">»</span> </li>
|
||||
<li><a href="/Consortium/">About W3C</a> <span class="cr">»</span> </li>
|
||||
<li><a href="/Consortium/facts.html">Facts About W3C</a> <span class="cr">»</span> </li>
|
||||
<li><a href="/Consortium/Legal/ipr-notice.html">Policies and Legal Information</a> <span class="cr">»</span> </li>
|
||||
<li class="current">W3C Software Notice and License</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<h1 class="title">W3C Software Notice and License</h1>
|
||||
<div id="w3c_content_body">
|
||||
<div class="line">
|
||||
<p class="intro tPadding">This work (and included software, documentation such as READMEs, or other
|
||||
related items) is being provided by the copyright holders under the following
|
||||
license.</p>
|
||||
<h2>License</h2>
|
||||
|
||||
<p class="tPadding">
|
||||
By obtaining, using and/or copying this work, you (the licensee)
|
||||
agree that you have read, understood, and will comply with the following
|
||||
terms and conditions.</p>
|
||||
|
||||
<p>Permission to copy, modify, and distribute this software and its
|
||||
documentation, with or without modification, for any purpose and without
|
||||
fee or royalty is hereby granted, provided that you include the following on
|
||||
ALL copies of the software and documentation or portions thereof, including
|
||||
modifications:</p>
|
||||
|
||||
<ul class="show_items"><li>The full text of this NOTICE in a location viewable to users of the
|
||||
redistributed or derivative work.</li><li>Any pre-existing intellectual property disclaimers, notices, or terms
|
||||
and conditions. If none exist, the <a href="copyright-software-short-notice-20021231.html">W3C Software Short
|
||||
Notice</a> should be included (hypertext is preferred, text is permitted)
|
||||
within the body of any redistributed or derivative code.</li><li>Notice of any changes or modifications to the files, including the date
|
||||
changes were made. (We recommend you provide URIs to the location from
|
||||
which the code is derived.)</li></ul>
|
||||
|
||||
<h2>Disclaimers</h2>
|
||||
|
||||
<p>THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS
|
||||
MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
|
||||
PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE
|
||||
ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.</p>
|
||||
|
||||
<p>COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
|
||||
DOCUMENTATION.</p>
|
||||
|
||||
<p>The name and trademarks of copyright holders may NOT be used in
|
||||
advertising or publicity pertaining to the software without specific, written
|
||||
prior permission. Title to copyright in this software and any associated
|
||||
documentation will at all times remain with copyright holders.</p>
|
||||
|
||||
<h2>Notes</h2>
|
||||
|
||||
<p>This version: http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231</p>
|
||||
|
||||
<p>This formulation of W3C's notice and license became active on December 31
|
||||
2002. This version removes the copyright ownership notice such that this
|
||||
license can be used with materials other than those owned by the W3C,
|
||||
reflects that ERCIM is now a host of the W3C, includes references to this
|
||||
specific dated version of the license, and removes the ambiguous grant of
|
||||
"use". Otherwise, this version is the same as the <a href="http://www.w3.org/Consortium/Legal/copyright-software-19980720">previous
|
||||
version</a> and is written so as to preserve the <a href="http://www.gnu.org/philosophy/license-list.html#GPLCompatibleLicenses">Free
|
||||
Software Foundation's assessment of GPL compatibility</a> and <a href="http://www.opensource.org/licenses/W3C.php">OSI's certification</a>
|
||||
under the <a href="http://www.opensource.org/docs/definition.php">Open Source
|
||||
Definition</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div><div id="w3c_footer">
|
||||
<div id="w3c_footer-inner">
|
||||
<h2 class="offscreen">Footer Navigation</h2>
|
||||
<div class="w3c_footer-nav">
|
||||
<h3>Navigation</h3>
|
||||
<ul class="footer_top_nav"><li>
|
||||
<a href="/">Home</a>
|
||||
</li><li>
|
||||
<a href="/standards/">Standards</a>
|
||||
</li><li>
|
||||
<a href="/participate/">Participate</a>
|
||||
</li><li>
|
||||
<a href="/Consortium/membership">Membership</a>
|
||||
</li><li class="last-item">
|
||||
<a href="/Consortium/">About W3C</a>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div class="w3c_footer-nav">
|
||||
<h3>Contact W3C</h3>
|
||||
<ul class="footer_bottom_nav"><li>
|
||||
<a href="/Consortium/contact">Contact</a>
|
||||
</li><li>
|
||||
<a accesskey="0" href="/Help/">Help and FAQ</a>
|
||||
</li><li>
|
||||
<a href="/Consortium/sponsor/">Sponsor / Donate</a>
|
||||
</li><li>
|
||||
<a href="/Consortium/siteindex">Site Map</a>
|
||||
</li><li>
|
||||
<address id="w3c_signature">
|
||||
<a href="http://lists.w3.org/Archives/Public/site-comments/">Feedback</a></address>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div class="w3c_footer-nav">
|
||||
<h3>W3C Updates</h3>
|
||||
<ul class="footer_follow_nav"><li>
|
||||
<a href="http://twitter.com/W3C" title="Follow W3C on Twitter">
|
||||
<img src="/2008/site/images/twitter-bird" alt="Twitter" width="78" height="83" class="social-icon" />
|
||||
</a>
|
||||
<a href="http://identi.ca/w3c" title="See W3C on Identica">
|
||||
<img src="/2008/site/images/identica-logo" alt="Identica" width="91" height="83" class="social-icon" />
|
||||
</a>
|
||||
</li></ul>
|
||||
</div>
|
||||
<p class="copyright">Copyright © 2012 W3C <sup>®</sup> (<a href="http://www.csail.mit.edu/">
|
||||
<acronym title="Massachusetts Institute of Technology">MIT</acronym>
|
||||
</a>, <a href="http://www.ercim.org/">
|
||||
<acronym title="European Research Consortium for Informatics and Mathematics"> ERCIM</acronym>
|
||||
</a>, <a href="http://www.keio.ac.jp/">Keio</a>) <a href="/Consortium/Legal/ipr-notice">Usage policies apply</a>.</p>
|
||||
</div>
|
||||
</div><!-- Generated from data/scripts.php, ../../smarty/{scripts.tpl} --><!-- At the bottom for performance reasons --><div id="w3c_scripts">
|
||||
<script type="text/javascript" src="/2008/site/js/main" xml:space="preserve"><!-- --></script>
|
||||
</div></body></html>
|
99
node_modules/sax/README.md
generated
vendored
99
node_modules/sax/README.md
generated
vendored
@ -9,7 +9,7 @@ the browser or other CommonJS implementations.
|
||||
|
||||
* A very simple tool to parse through an XML string.
|
||||
* A stepping stone to a streaming HTML parser.
|
||||
* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML
|
||||
* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML
|
||||
docs.
|
||||
|
||||
## What This Is (probably) Not
|
||||
@ -23,7 +23,7 @@ the browser or other CommonJS implementations.
|
||||
implementations are in Java and do a lot more than this does.
|
||||
* An XML Validator - It does a little validation when in strict mode, but
|
||||
not much.
|
||||
* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic
|
||||
* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic
|
||||
masochism.
|
||||
* A DTD-aware Thing - Fetching DTDs is a much bigger job.
|
||||
|
||||
@ -41,49 +41,48 @@ through unmolested.
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var sax = require("./lib/sax"),
|
||||
strict = true, // set to false for html-mode
|
||||
parser = sax.parser(strict);
|
||||
var sax = require("./lib/sax"),
|
||||
strict = true, // set to false for html-mode
|
||||
parser = sax.parser(strict);
|
||||
|
||||
parser.onerror = function (e) {
|
||||
// an error happened.
|
||||
};
|
||||
parser.ontext = function (t) {
|
||||
// got some text. t is the string of text.
|
||||
};
|
||||
parser.onopentag = function (node) {
|
||||
// opened a tag. node has "name" and "attributes"
|
||||
};
|
||||
parser.onattribute = function (attr) {
|
||||
// an attribute. attr has "name" and "value"
|
||||
};
|
||||
parser.onend = function () {
|
||||
// parser stream is done, and ready to have more stuff written to it.
|
||||
};
|
||||
parser.onerror = function (e) {
|
||||
// an error happened.
|
||||
};
|
||||
parser.ontext = function (t) {
|
||||
// got some text. t is the string of text.
|
||||
};
|
||||
parser.onopentag = function (node) {
|
||||
// opened a tag. node has "name" and "attributes"
|
||||
};
|
||||
parser.onattribute = function (attr) {
|
||||
// an attribute. attr has "name" and "value"
|
||||
};
|
||||
parser.onend = function () {
|
||||
// parser stream is done, and ready to have more stuff written to it.
|
||||
};
|
||||
|
||||
parser.write('<xml>Hello, <who name="world">world</who>!</xml>').close();
|
||||
parser.write('<xml>Hello, <who name="world">world</who>!</xml>').close();
|
||||
|
||||
// stream usage
|
||||
// takes the same options as the parser
|
||||
var saxStream = require("sax").createStream(strict, options)
|
||||
saxStream.on("error", function (e) {
|
||||
// unhandled errors will throw, since this is a proper node
|
||||
// event emitter.
|
||||
console.error("error!", e)
|
||||
// clear the error
|
||||
this._parser.error = null
|
||||
this._parser.resume()
|
||||
})
|
||||
saxStream.on("opentag", function (node) {
|
||||
// same object as above
|
||||
})
|
||||
// pipe is supported, and it's readable/writable
|
||||
// same chunks coming in also go out.
|
||||
fs.createReadStream("file.xml")
|
||||
.pipe(saxStream)
|
||||
.pipe(fs.createReadStream("file-copy.xml"))
|
||||
|
||||
// stream usage
|
||||
// takes the same options as the parser
|
||||
var saxStream = require("sax").createStream(strict, options)
|
||||
saxStream.on("error", function (e) {
|
||||
// unhandled errors will throw, since this is a proper node
|
||||
// event emitter.
|
||||
console.error("error!", e)
|
||||
// clear the error
|
||||
this._parser.error = null
|
||||
this._parser.resume()
|
||||
})
|
||||
saxStream.on("opentag", function (node) {
|
||||
// same object as above
|
||||
})
|
||||
// pipe is supported, and it's readable/writable
|
||||
// same chunks coming in also go out.
|
||||
fs.createReadStream("file.xml")
|
||||
.pipe(saxStream)
|
||||
.pipe(fs.createWriteStream("file-copy.xml"))
|
||||
```
|
||||
|
||||
|
||||
## Arguments
|
||||
@ -99,13 +98,9 @@ Settings supported:
|
||||
* `trim` - Boolean. Whether or not to trim text and comment nodes.
|
||||
* `normalize` - Boolean. If true, then turn any whitespace into a single
|
||||
space.
|
||||
* `lowercase` - Boolean. If true, then lowercase tag names and attribute names
|
||||
in loose mode, rather than uppercasing them.
|
||||
* `lowercasetags` - Boolean. If true, then lowercase tags in loose mode,
|
||||
rather than uppercasing them.
|
||||
* `xmlns` - Boolean. If true, then namespaces are supported.
|
||||
* `position` - Boolean. If false, then don't track line/col/position.
|
||||
* `strictEntities` - Boolean. If true, only parse [predefined XML
|
||||
entities](http://www.w3.org/TR/REC-xml/#sec-predefined-ent)
|
||||
(`&`, `'`, `>`, `<`, and `"`)
|
||||
|
||||
## Methods
|
||||
|
||||
@ -169,7 +164,7 @@ might go away at some point. SAX isn't intended to be used to parse SGML,
|
||||
after all.
|
||||
|
||||
`opentag` - An opening tag. Argument: object with `name` and `attributes`.
|
||||
In non-strict mode, tag names are uppercased, unless the `lowercase`
|
||||
In non-strict mode, tag names are uppercased, unless the `lowercasetags`
|
||||
option is set. If the `xmlns` option is set, then it will contain
|
||||
namespace binding information on the `ns` member, and will have a
|
||||
`local`, `prefix`, and `uri` member.
|
||||
@ -179,10 +174,8 @@ parent closes. In strict mode, well-formedness is enforced. Note that
|
||||
self-closing tags will have `closeTag` emitted immediately after `openTag`.
|
||||
Argument: tag name.
|
||||
|
||||
`attribute` - An attribute node. Argument: object with `name` and `value`.
|
||||
In non-strict mode, attribute names are uppercased, unless the `lowercase`
|
||||
option is set. If the `xmlns` option is set, it will also contains namespace
|
||||
information.
|
||||
`attribute` - An attribute node. Argument: object with `name` and `value`,
|
||||
and also namespace information if the `xmlns` option flag is set.
|
||||
|
||||
`comment` - A comment node. Argument: the string of the comment.
|
||||
|
||||
|
8002
node_modules/sax/examples/big-not-pretty.xml
generated
vendored
Normal file
8002
node_modules/sax/examples/big-not-pretty.xml
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
41
node_modules/sax/examples/example.js
generated
vendored
Normal file
41
node_modules/sax/examples/example.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
|
||||
var fs = require("fs"),
|
||||
sys = require("sys"),
|
||||
path = require("path"),
|
||||
xml = fs.cat(path.join(__dirname, "test.xml")),
|
||||
sax = require("../lib/sax"),
|
||||
strict = sax.parser(true),
|
||||
loose = sax.parser(false, {trim:true}),
|
||||
inspector = function (ev) { return function (data) {
|
||||
// sys.error("");
|
||||
// sys.error(ev+": "+sys.inspect(data));
|
||||
// for (var i in data) sys.error(i+ " "+sys.inspect(data[i]));
|
||||
// sys.error(this.line+":"+this.column);
|
||||
}};
|
||||
|
||||
xml.addCallback(function (xml) {
|
||||
// strict.write(xml);
|
||||
|
||||
sax.EVENTS.forEach(function (ev) {
|
||||
loose["on"+ev] = inspector(ev);
|
||||
});
|
||||
loose.onend = function () {
|
||||
// sys.error("end");
|
||||
// sys.error(sys.inspect(loose));
|
||||
};
|
||||
|
||||
// do this one char at a time to verify that it works.
|
||||
// (function () {
|
||||
// if (xml) {
|
||||
// loose.write(xml.substr(0,1000));
|
||||
// xml = xml.substr(1000);
|
||||
// process.nextTick(arguments.callee);
|
||||
// } else loose.close();
|
||||
// })();
|
||||
|
||||
for (var i = 0; i < 1000; i ++) {
|
||||
loose.write(xml);
|
||||
loose.close();
|
||||
}
|
||||
|
||||
});
|
58
node_modules/sax/examples/get-products.js
generated
vendored
Normal file
58
node_modules/sax/examples/get-products.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
// pull out /GeneralSearchResponse/categories/category/items/product tags
|
||||
// the rest we don't care about.
|
||||
|
||||
var sax = require("../lib/sax.js")
|
||||
var fs = require("fs")
|
||||
var path = require("path")
|
||||
var xmlFile = path.resolve(__dirname, "shopping.xml")
|
||||
var util = require("util")
|
||||
var http = require("http")
|
||||
|
||||
fs.readFile(xmlFile, function (er, d) {
|
||||
http.createServer(function (req, res) {
|
||||
if (er) throw er
|
||||
var xmlstr = d.toString("utf8")
|
||||
|
||||
var parser = sax.parser(true)
|
||||
var products = []
|
||||
var product = null
|
||||
var currentTag = null
|
||||
|
||||
parser.onclosetag = function (tagName) {
|
||||
if (tagName === "product") {
|
||||
products.push(product)
|
||||
currentTag = product = null
|
||||
return
|
||||
}
|
||||
if (currentTag && currentTag.parent) {
|
||||
var p = currentTag.parent
|
||||
delete currentTag.parent
|
||||
currentTag = p
|
||||
}
|
||||
}
|
||||
|
||||
parser.onopentag = function (tag) {
|
||||
if (tag.name !== "product" && !product) return
|
||||
if (tag.name === "product") {
|
||||
product = tag
|
||||
}
|
||||
tag.parent = currentTag
|
||||
tag.children = []
|
||||
tag.parent && tag.parent.children.push(tag)
|
||||
currentTag = tag
|
||||
}
|
||||
|
||||
parser.ontext = function (text) {
|
||||
if (currentTag) currentTag.children.push(text)
|
||||
}
|
||||
|
||||
parser.onend = function () {
|
||||
var out = util.inspect(products, false, 3, true)
|
||||
res.writeHead(200, {"content-type":"application/json"})
|
||||
res.end("{\"ok\":true}")
|
||||
// res.end(JSON.stringify(products))
|
||||
}
|
||||
|
||||
parser.write(xmlstr).end()
|
||||
}).listen(1337)
|
||||
})
|
4
node_modules/sax/examples/hello-world.js
generated
vendored
Normal file
4
node_modules/sax/examples/hello-world.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
require("http").createServer(function (req, res) {
|
||||
res.writeHead(200, {"content-type":"application/json"})
|
||||
res.end(JSON.stringify({ok: true}))
|
||||
}).listen(1337)
|
8
node_modules/sax/examples/not-pretty.xml
generated
vendored
Normal file
8
node_modules/sax/examples/not-pretty.xml
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
<root>
|
||||
something<else> blerm <slurm
|
||||
|
||||
|
||||
attrib =
|
||||
"blorg" ></else><!-- COMMENT!
|
||||
|
||||
--><![CDATA[processing...]]> <selfclosing tag="blr>""/> a bit down here</root>
|
74
node_modules/sax/examples/pretty-print.js
generated
vendored
Normal file
74
node_modules/sax/examples/pretty-print.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
var sax = require("../lib/sax")
|
||||
, printer = sax.createStream(false, {lowercasetags:true, trim:true})
|
||||
, fs = require("fs")
|
||||
|
||||
function entity (str) {
|
||||
return str.replace('"', '"')
|
||||
}
|
||||
|
||||
printer.tabstop = 2
|
||||
printer.level = 0
|
||||
printer.indent = function () {
|
||||
print("\n")
|
||||
for (var i = this.level; i > 0; i --) {
|
||||
for (var j = this.tabstop; j > 0; j --) {
|
||||
print(" ")
|
||||
}
|
||||
}
|
||||
}
|
||||
printer.on("opentag", function (tag) {
|
||||
this.indent()
|
||||
this.level ++
|
||||
print("<"+tag.name)
|
||||
for (var i in tag.attributes) {
|
||||
print(" "+i+"=\""+entity(tag.attributes[i])+"\"")
|
||||
}
|
||||
print(">")
|
||||
})
|
||||
|
||||
printer.on("text", ontext)
|
||||
printer.on("doctype", ontext)
|
||||
function ontext (text) {
|
||||
this.indent()
|
||||
print(text)
|
||||
}
|
||||
|
||||
printer.on("closetag", function (tag) {
|
||||
this.level --
|
||||
this.indent()
|
||||
print("</"+tag+">")
|
||||
})
|
||||
|
||||
printer.on("cdata", function (data) {
|
||||
this.indent()
|
||||
print("<![CDATA["+data+"]]>")
|
||||
})
|
||||
|
||||
printer.on("comment", function (comment) {
|
||||
this.indent()
|
||||
print("<!--"+comment+"-->")
|
||||
})
|
||||
|
||||
printer.on("error", function (error) {
|
||||
console.error(error)
|
||||
throw error
|
||||
})
|
||||
|
||||
if (!process.argv[2]) {
|
||||
throw new Error("Please provide an xml file to prettify\n"+
|
||||
"TODO: read from stdin or take a file")
|
||||
}
|
||||
var xmlfile = require("path").join(process.cwd(), process.argv[2])
|
||||
var fstr = fs.createReadStream(xmlfile, { encoding: "utf8" })
|
||||
|
||||
function print (c) {
|
||||
if (!process.stdout.write(c)) {
|
||||
fstr.pause()
|
||||
}
|
||||
}
|
||||
|
||||
process.stdout.on("drain", function () {
|
||||
fstr.resume()
|
||||
})
|
||||
|
||||
fstr.pipe(printer)
|
2
node_modules/sax/examples/shopping.xml
generated
vendored
Normal file
2
node_modules/sax/examples/shopping.xml
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
870
node_modules/sax/examples/strict.dtd
generated
vendored
Normal file
870
node_modules/sax/examples/strict.dtd
generated
vendored
Normal file
@ -0,0 +1,870 @@
|
||||
<!--
|
||||
This is HTML 4.01 Strict DTD, which excludes the presentation
|
||||
attributes and elements that W3C expects to phase out as
|
||||
support for style sheets matures. Authors should use the Strict
|
||||
DTD when possible, but may use the Transitional DTD when support
|
||||
for presentation attribute and elements is required.
|
||||
|
||||
HTML 4 includes mechanisms for style sheets, scripting,
|
||||
embedding objects, improved support for right to left and mixed
|
||||
direction text, and enhancements to forms for improved
|
||||
accessibility for people with disabilities.
|
||||
|
||||
Draft: $Date: 1999/12/24 23:37:48 $
|
||||
|
||||
Authors:
|
||||
Dave Raggett <dsr@w3.org>
|
||||
Arnaud Le Hors <lehors@w3.org>
|
||||
Ian Jacobs <ij@w3.org>
|
||||
|
||||
Further information about HTML 4.01 is available at:
|
||||
|
||||
http://www.w3.org/TR/1999/REC-html401-19991224
|
||||
|
||||
|
||||
The HTML 4.01 specification includes additional
|
||||
syntactic constraints that cannot be expressed within
|
||||
the DTDs.
|
||||
|
||||
-->
|
||||
<!--
|
||||
Typical usage:
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
...
|
||||
</head>
|
||||
<body>
|
||||
...
|
||||
</body>
|
||||
</html>
|
||||
|
||||
The URI used as a system identifier with the public identifier allows
|
||||
the user agent to download the DTD and entity sets as needed.
|
||||
|
||||
The FPI for the Transitional HTML 4.01 DTD is:
|
||||
|
||||
"-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
|
||||
This version of the transitional DTD is:
|
||||
|
||||
http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd
|
||||
|
||||
If you are writing a document that includes frames, use
|
||||
the following FPI:
|
||||
|
||||
"-//W3C//DTD HTML 4.01 Frameset//EN"
|
||||
|
||||
This version of the frameset DTD is:
|
||||
|
||||
http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd
|
||||
|
||||
Use the following (relative) URIs to refer to
|
||||
the DTDs and entity definitions of this specification:
|
||||
|
||||
"strict.dtd"
|
||||
"loose.dtd"
|
||||
"frameset.dtd"
|
||||
"HTMLlat1.ent"
|
||||
"HTMLsymbol.ent"
|
||||
"HTMLspecial.ent"
|
||||
|
||||
-->
|
||||
|
||||
<!--================== Imported Names ====================================-->
|
||||
<!-- Feature Switch for frameset documents -->
|
||||
<!ENTITY % HTML.Frameset "IGNORE">
|
||||
|
||||
<!ENTITY % ContentType "CDATA"
|
||||
-- media type, as per [RFC2045]
|
||||
-->
|
||||
|
||||
<!ENTITY % ContentTypes "CDATA"
|
||||
-- comma-separated list of media types, as per [RFC2045]
|
||||
-->
|
||||
|
||||
<!ENTITY % Charset "CDATA"
|
||||
-- a character encoding, as per [RFC2045]
|
||||
-->
|
||||
|
||||
<!ENTITY % Charsets "CDATA"
|
||||
-- a space-separated list of character encodings, as per [RFC2045]
|
||||
-->
|
||||
|
||||
<!ENTITY % LanguageCode "NAME"
|
||||
-- a language code, as per [RFC1766]
|
||||
-->
|
||||
|
||||
<!ENTITY % Character "CDATA"
|
||||
-- a single character from [ISO10646]
|
||||
-->
|
||||
|
||||
<!ENTITY % LinkTypes "CDATA"
|
||||
-- space-separated list of link types
|
||||
-->
|
||||
|
||||
<!ENTITY % MediaDesc "CDATA"
|
||||
-- single or comma-separated list of media descriptors
|
||||
-->
|
||||
|
||||
<!ENTITY % URI "CDATA"
|
||||
-- a Uniform Resource Identifier,
|
||||
see [URI]
|
||||
-->
|
||||
|
||||
<!ENTITY % Datetime "CDATA" -- date and time information. ISO date format -->
|
||||
|
||||
|
||||
<!ENTITY % Script "CDATA" -- script expression -->
|
||||
|
||||
<!ENTITY % StyleSheet "CDATA" -- style sheet data -->
|
||||
|
||||
|
||||
|
||||
<!ENTITY % Text "CDATA">
|
||||
|
||||
|
||||
<!-- Parameter Entities -->
|
||||
|
||||
<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" -- repeatable head elements -->
|
||||
|
||||
<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
|
||||
|
||||
<!ENTITY % list "UL | OL">
|
||||
|
||||
<!ENTITY % preformatted "PRE">
|
||||
|
||||
|
||||
<!--================ Character mnemonic entities =========================-->
|
||||
|
||||
<!ENTITY % HTMLlat1 PUBLIC
|
||||
"-//W3C//ENTITIES Latin1//EN//HTML"
|
||||
"HTMLlat1.ent">
|
||||
%HTMLlat1;
|
||||
|
||||
<!ENTITY % HTMLsymbol PUBLIC
|
||||
"-//W3C//ENTITIES Symbols//EN//HTML"
|
||||
"HTMLsymbol.ent">
|
||||
%HTMLsymbol;
|
||||
|
||||
<!ENTITY % HTMLspecial PUBLIC
|
||||
"-//W3C//ENTITIES Special//EN//HTML"
|
||||
"HTMLspecial.ent">
|
||||
%HTMLspecial;
|
||||
<!--=================== Generic Attributes ===============================-->
|
||||
|
||||
<!ENTITY % coreattrs
|
||||
"id ID #IMPLIED -- document-wide unique id --
|
||||
class CDATA #IMPLIED -- space-separated list of classes --
|
||||
style %StyleSheet; #IMPLIED -- associated style info --
|
||||
title %Text; #IMPLIED -- advisory title --"
|
||||
>
|
||||
|
||||
<!ENTITY % i18n
|
||||
"lang %LanguageCode; #IMPLIED -- language code --
|
||||
dir (ltr|rtl) #IMPLIED -- direction for weak/neutral text --"
|
||||
>
|
||||
|
||||
<!ENTITY % events
|
||||
"onclick %Script; #IMPLIED -- a pointer button was clicked --
|
||||
ondblclick %Script; #IMPLIED -- a pointer button was double clicked--
|
||||
onmousedown %Script; #IMPLIED -- a pointer button was pressed down --
|
||||
onmouseup %Script; #IMPLIED -- a pointer button was released --
|
||||
onmouseover %Script; #IMPLIED -- a pointer was moved onto --
|
||||
onmousemove %Script; #IMPLIED -- a pointer was moved within --
|
||||
onmouseout %Script; #IMPLIED -- a pointer was moved away --
|
||||
onkeypress %Script; #IMPLIED -- a key was pressed and released --
|
||||
onkeydown %Script; #IMPLIED -- a key was pressed down --
|
||||
onkeyup %Script; #IMPLIED -- a key was released --"
|
||||
>
|
||||
|
||||
<!-- Reserved Feature Switch -->
|
||||
<!ENTITY % HTML.Reserved "IGNORE">
|
||||
|
||||
<!-- The following attributes are reserved for possible future use -->
|
||||
<![ %HTML.Reserved; [
|
||||
<!ENTITY % reserved
|
||||
"datasrc %URI; #IMPLIED -- a single or tabular Data Source --
|
||||
datafld CDATA #IMPLIED -- the property or column name --
|
||||
dataformatas (plaintext|html) plaintext -- text or html --"
|
||||
>
|
||||
]]>
|
||||
|
||||
<!ENTITY % reserved "">
|
||||
|
||||
<!ENTITY % attrs "%coreattrs; %i18n; %events;">
|
||||
|
||||
|
||||
<!--=================== Text Markup ======================================-->
|
||||
|
||||
<!ENTITY % fontstyle
|
||||
"TT | I | B | BIG | SMALL">
|
||||
|
||||
<!ENTITY % phrase "EM | STRONG | DFN | CODE |
|
||||
SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
|
||||
|
||||
<!ENTITY % special
|
||||
"A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO">
|
||||
|
||||
<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
|
||||
|
||||
<!-- %inline; covers inline or "text-level" elements -->
|
||||
<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
|
||||
|
||||
<!ELEMENT (%fontstyle;|%phrase;) - - (%inline;)*>
|
||||
<!ATTLIST (%fontstyle;|%phrase;)
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!ELEMENT (SUB|SUP) - - (%inline;)* -- subscript, superscript -->
|
||||
<!ATTLIST (SUB|SUP)
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!ELEMENT SPAN - - (%inline;)* -- generic language/style container -->
|
||||
<!ATTLIST SPAN
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
%reserved; -- reserved for possible future use --
|
||||
>
|
||||
|
||||
<!ELEMENT BDO - - (%inline;)* -- I18N BiDi over-ride -->
|
||||
<!ATTLIST BDO
|
||||
%coreattrs; -- id, class, style, title --
|
||||
lang %LanguageCode; #IMPLIED -- language code --
|
||||
dir (ltr|rtl) #REQUIRED -- directionality --
|
||||
>
|
||||
|
||||
|
||||
<!ELEMENT BR - O EMPTY -- forced line break -->
|
||||
<!ATTLIST BR
|
||||
%coreattrs; -- id, class, style, title --
|
||||
>
|
||||
|
||||
<!--================== HTML content models ===============================-->
|
||||
|
||||
<!--
|
||||
HTML has two basic content models:
|
||||
|
||||
%inline; character level elements and text strings
|
||||
%block; block-like elements e.g. paragraphs and lists
|
||||
-->
|
||||
|
||||
<!ENTITY % block
|
||||
"P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
|
||||
BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
|
||||
|
||||
<!ENTITY % flow "%block; | %inline;">
|
||||
|
||||
<!--=================== Document Body ====================================-->
|
||||
|
||||
<!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->
|
||||
<!ATTLIST BODY
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
onload %Script; #IMPLIED -- the document has been loaded --
|
||||
onunload %Script; #IMPLIED -- the document has been removed --
|
||||
>
|
||||
|
||||
<!ELEMENT ADDRESS - - (%inline;)* -- information on author -->
|
||||
<!ATTLIST ADDRESS
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!ELEMENT DIV - - (%flow;)* -- generic language/style container -->
|
||||
<!ATTLIST DIV
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
%reserved; -- reserved for possible future use --
|
||||
>
|
||||
|
||||
|
||||
<!--================== The Anchor Element ================================-->
|
||||
|
||||
<!ENTITY % Shape "(rect|circle|poly|default)">
|
||||
<!ENTITY % Coords "CDATA" -- comma-separated list of lengths -->
|
||||
|
||||
<!ELEMENT A - - (%inline;)* -(A) -- anchor -->
|
||||
<!ATTLIST A
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
charset %Charset; #IMPLIED -- char encoding of linked resource --
|
||||
type %ContentType; #IMPLIED -- advisory content type --
|
||||
name CDATA #IMPLIED -- named link end --
|
||||
href %URI; #IMPLIED -- URI for linked resource --
|
||||
hreflang %LanguageCode; #IMPLIED -- language code --
|
||||
rel %LinkTypes; #IMPLIED -- forward link types --
|
||||
rev %LinkTypes; #IMPLIED -- reverse link types --
|
||||
accesskey %Character; #IMPLIED -- accessibility key character --
|
||||
shape %Shape; rect -- for use with client-side image maps --
|
||||
coords %Coords; #IMPLIED -- for use with client-side image maps --
|
||||
tabindex NUMBER #IMPLIED -- position in tabbing order --
|
||||
onfocus %Script; #IMPLIED -- the element got the focus --
|
||||
onblur %Script; #IMPLIED -- the element lost the focus --
|
||||
>
|
||||
|
||||
<!--================== Client-side image maps ============================-->
|
||||
|
||||
<!-- These can be placed in the same document or grouped in a
|
||||
separate document although this isn't yet widely supported -->
|
||||
|
||||
<!ELEMENT MAP - - ((%block;) | AREA)+ -- client-side image map -->
|
||||
<!ATTLIST MAP
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
name CDATA #REQUIRED -- for reference by usemap --
|
||||
>
|
||||
|
||||
<!ELEMENT AREA - O EMPTY -- client-side image map area -->
|
||||
<!ATTLIST AREA
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
shape %Shape; rect -- controls interpretation of coords --
|
||||
coords %Coords; #IMPLIED -- comma-separated list of lengths --
|
||||
href %URI; #IMPLIED -- URI for linked resource --
|
||||
nohref (nohref) #IMPLIED -- this region has no action --
|
||||
alt %Text; #REQUIRED -- short description --
|
||||
tabindex NUMBER #IMPLIED -- position in tabbing order --
|
||||
accesskey %Character; #IMPLIED -- accessibility key character --
|
||||
onfocus %Script; #IMPLIED -- the element got the focus --
|
||||
onblur %Script; #IMPLIED -- the element lost the focus --
|
||||
>
|
||||
|
||||
<!--================== The LINK Element ==================================-->
|
||||
|
||||
<!--
|
||||
Relationship values can be used in principle:
|
||||
|
||||
a) for document specific toolbars/menus when used
|
||||
with the LINK element in document head e.g.
|
||||
start, contents, previous, next, index, end, help
|
||||
b) to link to a separate style sheet (rel=stylesheet)
|
||||
c) to make a link to a script (rel=script)
|
||||
d) by stylesheets to control how collections of
|
||||
html nodes are rendered into printed documents
|
||||
e) to make a link to a printable version of this document
|
||||
e.g. a postscript or pdf version (rel=alternate media=print)
|
||||
-->
|
||||
|
||||
<!ELEMENT LINK - O EMPTY -- a media-independent link -->
|
||||
<!ATTLIST LINK
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
charset %Charset; #IMPLIED -- char encoding of linked resource --
|
||||
href %URI; #IMPLIED -- URI for linked resource --
|
||||
hreflang %LanguageCode; #IMPLIED -- language code --
|
||||
type %ContentType; #IMPLIED -- advisory content type --
|
||||
rel %LinkTypes; #IMPLIED -- forward link types --
|
||||
rev %LinkTypes; #IMPLIED -- reverse link types --
|
||||
media %MediaDesc; #IMPLIED -- for rendering on these media --
|
||||
>
|
||||
|
||||
<!--=================== Images ===========================================-->
|
||||
|
||||
<!-- Length defined in strict DTD for cellpadding/cellspacing -->
|
||||
<!ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length -->
|
||||
<!ENTITY % MultiLength "CDATA" -- pixel, percentage, or relative -->
|
||||
|
||||
<![ %HTML.Frameset; [
|
||||
<!ENTITY % MultiLengths "CDATA" -- comma-separated list of MultiLength -->
|
||||
]]>
|
||||
|
||||
<!ENTITY % Pixels "CDATA" -- integer representing length in pixels -->
|
||||
|
||||
|
||||
<!-- To avoid problems with text-only UAs as well as
|
||||
to make image content understandable and navigable
|
||||
to users of non-visual UAs, you need to provide
|
||||
a description with ALT, and avoid server-side image maps -->
|
||||
<!ELEMENT IMG - O EMPTY -- Embedded image -->
|
||||
<!ATTLIST IMG
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
src %URI; #REQUIRED -- URI of image to embed --
|
||||
alt %Text; #REQUIRED -- short description --
|
||||
longdesc %URI; #IMPLIED -- link to long description
|
||||
(complements alt) --
|
||||
name CDATA #IMPLIED -- name of image for scripting --
|
||||
height %Length; #IMPLIED -- override height --
|
||||
width %Length; #IMPLIED -- override width --
|
||||
usemap %URI; #IMPLIED -- use client-side image map --
|
||||
ismap (ismap) #IMPLIED -- use server-side image map --
|
||||
>
|
||||
|
||||
<!-- USEMAP points to a MAP element which may be in this document
|
||||
or an external document, although the latter is not widely supported -->
|
||||
|
||||
<!--==================== OBJECT ======================================-->
|
||||
<!--
|
||||
OBJECT is used to embed objects as part of HTML pages
|
||||
PARAM elements should precede other content. SGML mixed content
|
||||
model technicality precludes specifying this formally ...
|
||||
-->
|
||||
|
||||
<!ELEMENT OBJECT - - (PARAM | %flow;)*
|
||||
-- generic embedded object -->
|
||||
<!ATTLIST OBJECT
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
declare (declare) #IMPLIED -- declare but don't instantiate flag --
|
||||
classid %URI; #IMPLIED -- identifies an implementation --
|
||||
codebase %URI; #IMPLIED -- base URI for classid, data, archive--
|
||||
data %URI; #IMPLIED -- reference to object's data --
|
||||
type %ContentType; #IMPLIED -- content type for data --
|
||||
codetype %ContentType; #IMPLIED -- content type for code --
|
||||
archive CDATA #IMPLIED -- space-separated list of URIs --
|
||||
standby %Text; #IMPLIED -- message to show while loading --
|
||||
height %Length; #IMPLIED -- override height --
|
||||
width %Length; #IMPLIED -- override width --
|
||||
usemap %URI; #IMPLIED -- use client-side image map --
|
||||
name CDATA #IMPLIED -- submit as part of form --
|
||||
tabindex NUMBER #IMPLIED -- position in tabbing order --
|
||||
%reserved; -- reserved for possible future use --
|
||||
>
|
||||
|
||||
<!ELEMENT PARAM - O EMPTY -- named property value -->
|
||||
<!ATTLIST PARAM
|
||||
id ID #IMPLIED -- document-wide unique id --
|
||||
name CDATA #REQUIRED -- property name --
|
||||
value CDATA #IMPLIED -- property value --
|
||||
valuetype (DATA|REF|OBJECT) DATA -- How to interpret value --
|
||||
type %ContentType; #IMPLIED -- content type for value
|
||||
when valuetype=ref --
|
||||
>
|
||||
|
||||
|
||||
<!--=================== Horizontal Rule ==================================-->
|
||||
|
||||
<!ELEMENT HR - O EMPTY -- horizontal rule -->
|
||||
<!ATTLIST HR
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!--=================== Paragraphs =======================================-->
|
||||
|
||||
<!ELEMENT P - O (%inline;)* -- paragraph -->
|
||||
<!ATTLIST P
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!--=================== Headings =========================================-->
|
||||
|
||||
<!--
|
||||
There are six levels of headings from H1 (the most important)
|
||||
to H6 (the least important).
|
||||
-->
|
||||
|
||||
<!ELEMENT (%heading;) - - (%inline;)* -- heading -->
|
||||
<!ATTLIST (%heading;)
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!--=================== Preformatted Text ================================-->
|
||||
|
||||
<!-- excludes markup for images and changes in font size -->
|
||||
<!ENTITY % pre.exclusion "IMG|OBJECT|BIG|SMALL|SUB|SUP">
|
||||
|
||||
<!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->
|
||||
<!ATTLIST PRE
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!--===================== Inline Quotes ==================================-->
|
||||
|
||||
<!ELEMENT Q - - (%inline;)* -- short inline quotation -->
|
||||
<!ATTLIST Q
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
cite %URI; #IMPLIED -- URI for source document or msg --
|
||||
>
|
||||
|
||||
<!--=================== Block-like Quotes ================================-->
|
||||
|
||||
<!ELEMENT BLOCKQUOTE - - (%block;|SCRIPT)+ -- long quotation -->
|
||||
<!ATTLIST BLOCKQUOTE
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
cite %URI; #IMPLIED -- URI for source document or msg --
|
||||
>
|
||||
|
||||
<!--=================== Inserted/Deleted Text ============================-->
|
||||
|
||||
|
||||
<!-- INS/DEL are handled by inclusion on BODY -->
|
||||
<!ELEMENT (INS|DEL) - - (%flow;)* -- inserted text, deleted text -->
|
||||
<!ATTLIST (INS|DEL)
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
cite %URI; #IMPLIED -- info on reason for change --
|
||||
datetime %Datetime; #IMPLIED -- date and time of change --
|
||||
>
|
||||
|
||||
<!--=================== Lists ============================================-->
|
||||
|
||||
<!-- definition lists - DT for term, DD for its definition -->
|
||||
|
||||
<!ELEMENT DL - - (DT|DD)+ -- definition list -->
|
||||
<!ATTLIST DL
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!ELEMENT DT - O (%inline;)* -- definition term -->
|
||||
<!ELEMENT DD - O (%flow;)* -- definition description -->
|
||||
<!ATTLIST (DT|DD)
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
|
||||
<!ELEMENT OL - - (LI)+ -- ordered list -->
|
||||
<!ATTLIST OL
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!-- Unordered Lists (UL) bullet styles -->
|
||||
<!ELEMENT UL - - (LI)+ -- unordered list -->
|
||||
<!ATTLIST UL
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
|
||||
|
||||
<!ELEMENT LI - O (%flow;)* -- list item -->
|
||||
<!ATTLIST LI
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!--================ Forms ===============================================-->
|
||||
<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->
|
||||
<!ATTLIST FORM
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
action %URI; #REQUIRED -- server-side form handler --
|
||||
method (GET|POST) GET -- HTTP method used to submit the form--
|
||||
enctype %ContentType; "application/x-www-form-urlencoded"
|
||||
accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
|
||||
name CDATA #IMPLIED -- name of form for scripting --
|
||||
onsubmit %Script; #IMPLIED -- the form was submitted --
|
||||
onreset %Script; #IMPLIED -- the form was reset --
|
||||
accept-charset %Charsets; #IMPLIED -- list of supported charsets --
|
||||
>
|
||||
|
||||
<!-- Each label must not contain more than ONE field -->
|
||||
<!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
|
||||
<!ATTLIST LABEL
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
for IDREF #IMPLIED -- matches field ID value --
|
||||
accesskey %Character; #IMPLIED -- accessibility key character --
|
||||
onfocus %Script; #IMPLIED -- the element got the focus --
|
||||
onblur %Script; #IMPLIED -- the element lost the focus --
|
||||
>
|
||||
|
||||
<!ENTITY % InputType
|
||||
"(TEXT | PASSWORD | CHECKBOX |
|
||||
RADIO | SUBMIT | RESET |
|
||||
FILE | HIDDEN | IMAGE | BUTTON)"
|
||||
>
|
||||
|
||||
<!-- attribute name required for all but submit and reset -->
|
||||
<!ELEMENT INPUT - O EMPTY -- form control -->
|
||||
<!ATTLIST INPUT
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
type %InputType; TEXT -- what kind of widget is needed --
|
||||
name CDATA #IMPLIED -- submit as part of form --
|
||||
value CDATA #IMPLIED -- Specify for radio buttons and checkboxes --
|
||||
checked (checked) #IMPLIED -- for radio buttons and check boxes --
|
||||
disabled (disabled) #IMPLIED -- unavailable in this context --
|
||||
readonly (readonly) #IMPLIED -- for text and passwd --
|
||||
size CDATA #IMPLIED -- specific to each type of field --
|
||||
maxlength NUMBER #IMPLIED -- max chars for text fields --
|
||||
src %URI; #IMPLIED -- for fields with images --
|
||||
alt CDATA #IMPLIED -- short description --
|
||||
usemap %URI; #IMPLIED -- use client-side image map --
|
||||
ismap (ismap) #IMPLIED -- use server-side image map --
|
||||
tabindex NUMBER #IMPLIED -- position in tabbing order --
|
||||
accesskey %Character; #IMPLIED -- accessibility key character --
|
||||
onfocus %Script; #IMPLIED -- the element got the focus --
|
||||
onblur %Script; #IMPLIED -- the element lost the focus --
|
||||
onselect %Script; #IMPLIED -- some text was selected --
|
||||
onchange %Script; #IMPLIED -- the element value was changed --
|
||||
accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
|
||||
%reserved; -- reserved for possible future use --
|
||||
>
|
||||
|
||||
<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->
|
||||
<!ATTLIST SELECT
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
name CDATA #IMPLIED -- field name --
|
||||
size NUMBER #IMPLIED -- rows visible --
|
||||
multiple (multiple) #IMPLIED -- default is single selection --
|
||||
disabled (disabled) #IMPLIED -- unavailable in this context --
|
||||
tabindex NUMBER #IMPLIED -- position in tabbing order --
|
||||
onfocus %Script; #IMPLIED -- the element got the focus --
|
||||
onblur %Script; #IMPLIED -- the element lost the focus --
|
||||
onchange %Script; #IMPLIED -- the element value was changed --
|
||||
%reserved; -- reserved for possible future use --
|
||||
>
|
||||
|
||||
<!ELEMENT OPTGROUP - - (OPTION)+ -- option group -->
|
||||
<!ATTLIST OPTGROUP
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
disabled (disabled) #IMPLIED -- unavailable in this context --
|
||||
label %Text; #REQUIRED -- for use in hierarchical menus --
|
||||
>
|
||||
|
||||
<!ELEMENT OPTION - O (#PCDATA) -- selectable choice -->
|
||||
<!ATTLIST OPTION
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
selected (selected) #IMPLIED
|
||||
disabled (disabled) #IMPLIED -- unavailable in this context --
|
||||
label %Text; #IMPLIED -- for use in hierarchical menus --
|
||||
value CDATA #IMPLIED -- defaults to element content --
|
||||
>
|
||||
|
||||
<!ELEMENT TEXTAREA - - (#PCDATA) -- multi-line text field -->
|
||||
<!ATTLIST TEXTAREA
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
name CDATA #IMPLIED
|
||||
rows NUMBER #REQUIRED
|
||||
cols NUMBER #REQUIRED
|
||||
disabled (disabled) #IMPLIED -- unavailable in this context --
|
||||
readonly (readonly) #IMPLIED
|
||||
tabindex NUMBER #IMPLIED -- position in tabbing order --
|
||||
accesskey %Character; #IMPLIED -- accessibility key character --
|
||||
onfocus %Script; #IMPLIED -- the element got the focus --
|
||||
onblur %Script; #IMPLIED -- the element lost the focus --
|
||||
onselect %Script; #IMPLIED -- some text was selected --
|
||||
onchange %Script; #IMPLIED -- the element value was changed --
|
||||
%reserved; -- reserved for possible future use --
|
||||
>
|
||||
|
||||
<!--
|
||||
#PCDATA is to solve the mixed content problem,
|
||||
per specification only whitespace is allowed there!
|
||||
-->
|
||||
<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
|
||||
<!ATTLIST FIELDSET
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!ELEMENT LEGEND - - (%inline;)* -- fieldset legend -->
|
||||
|
||||
<!ATTLIST LEGEND
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
accesskey %Character; #IMPLIED -- accessibility key character --
|
||||
>
|
||||
|
||||
<!ELEMENT BUTTON - -
|
||||
(%flow;)* -(A|%formctrl;|FORM|FIELDSET)
|
||||
-- push button -->
|
||||
<!ATTLIST BUTTON
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
name CDATA #IMPLIED
|
||||
value CDATA #IMPLIED -- sent to server when submitted --
|
||||
type (button|submit|reset) submit -- for use as form button --
|
||||
disabled (disabled) #IMPLIED -- unavailable in this context --
|
||||
tabindex NUMBER #IMPLIED -- position in tabbing order --
|
||||
accesskey %Character; #IMPLIED -- accessibility key character --
|
||||
onfocus %Script; #IMPLIED -- the element got the focus --
|
||||
onblur %Script; #IMPLIED -- the element lost the focus --
|
||||
%reserved; -- reserved for possible future use --
|
||||
>
|
||||
|
||||
<!--======================= Tables =======================================-->
|
||||
|
||||
<!-- IETF HTML table standard, see [RFC1942] -->
|
||||
|
||||
<!--
|
||||
The BORDER attribute sets the thickness of the frame around the
|
||||
table. The default units are screen pixels.
|
||||
|
||||
The FRAME attribute specifies which parts of the frame around
|
||||
the table should be rendered. The values are not the same as
|
||||
CALS to avoid a name clash with the VALIGN attribute.
|
||||
|
||||
The value "border" is included for backwards compatibility with
|
||||
<TABLE BORDER> which yields frame=border and border=implied
|
||||
For <TABLE BORDER=1> you get border=1 and frame=implied. In this
|
||||
case, it is appropriate to treat this as frame=border for backwards
|
||||
compatibility with deployed browsers.
|
||||
-->
|
||||
<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
|
||||
|
||||
<!--
|
||||
The RULES attribute defines which rules to draw between cells:
|
||||
|
||||
If RULES is absent then assume:
|
||||
"none" if BORDER is absent or BORDER=0 otherwise "all"
|
||||
-->
|
||||
|
||||
<!ENTITY % TRules "(none | groups | rows | cols | all)">
|
||||
|
||||
<!-- horizontal placement of table relative to document -->
|
||||
<!ENTITY % TAlign "(left|center|right)">
|
||||
|
||||
<!-- horizontal alignment attributes for cell contents -->
|
||||
<!ENTITY % cellhalign
|
||||
"align (left|center|right|justify|char) #IMPLIED
|
||||
char %Character; #IMPLIED -- alignment char, e.g. char=':' --
|
||||
charoff %Length; #IMPLIED -- offset for alignment char --"
|
||||
>
|
||||
|
||||
<!-- vertical alignment attributes for cell contents -->
|
||||
<!ENTITY % cellvalign
|
||||
"valign (top|middle|bottom|baseline) #IMPLIED"
|
||||
>
|
||||
|
||||
<!ELEMENT TABLE - -
|
||||
(CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
|
||||
<!ELEMENT CAPTION - - (%inline;)* -- table caption -->
|
||||
<!ELEMENT THEAD - O (TR)+ -- table header -->
|
||||
<!ELEMENT TFOOT - O (TR)+ -- table footer -->
|
||||
<!ELEMENT TBODY O O (TR)+ -- table body -->
|
||||
<!ELEMENT COLGROUP - O (COL)* -- table column group -->
|
||||
<!ELEMENT COL - O EMPTY -- table column -->
|
||||
<!ELEMENT TR - O (TH|TD)+ -- table row -->
|
||||
<!ELEMENT (TH|TD) - O (%flow;)* -- table header cell, table data cell-->
|
||||
|
||||
<!ATTLIST TABLE -- table element --
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
summary %Text; #IMPLIED -- purpose/structure for speech output--
|
||||
width %Length; #IMPLIED -- table width --
|
||||
border %Pixels; #IMPLIED -- controls frame width around table --
|
||||
frame %TFrame; #IMPLIED -- which parts of frame to render --
|
||||
rules %TRules; #IMPLIED -- rulings between rows and cols --
|
||||
cellspacing %Length; #IMPLIED -- spacing between cells --
|
||||
cellpadding %Length; #IMPLIED -- spacing within cells --
|
||||
%reserved; -- reserved for possible future use --
|
||||
datapagesize CDATA #IMPLIED -- reserved for possible future use --
|
||||
>
|
||||
|
||||
|
||||
<!ATTLIST CAPTION
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!--
|
||||
COLGROUP groups a set of COL elements. It allows you to group
|
||||
several semantically related columns together.
|
||||
-->
|
||||
<!ATTLIST COLGROUP
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
span NUMBER 1 -- default number of columns in group --
|
||||
width %MultiLength; #IMPLIED -- default width for enclosed COLs --
|
||||
%cellhalign; -- horizontal alignment in cells --
|
||||
%cellvalign; -- vertical alignment in cells --
|
||||
>
|
||||
|
||||
<!--
|
||||
COL elements define the alignment properties for cells in
|
||||
one or more columns.
|
||||
|
||||
The WIDTH attribute specifies the width of the columns, e.g.
|
||||
|
||||
width=64 width in screen pixels
|
||||
width=0.5* relative width of 0.5
|
||||
|
||||
The SPAN attribute causes the attributes of one
|
||||
COL element to apply to more than one column.
|
||||
-->
|
||||
<!ATTLIST COL -- column groups and properties --
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
span NUMBER 1 -- COL attributes affect N columns --
|
||||
width %MultiLength; #IMPLIED -- column width specification --
|
||||
%cellhalign; -- horizontal alignment in cells --
|
||||
%cellvalign; -- vertical alignment in cells --
|
||||
>
|
||||
|
||||
<!--
|
||||
Use THEAD to duplicate headers when breaking table
|
||||
across page boundaries, or for static headers when
|
||||
TBODY sections are rendered in scrolling panel.
|
||||
|
||||
Use TFOOT to duplicate footers when breaking table
|
||||
across page boundaries, or for static footers when
|
||||
TBODY sections are rendered in scrolling panel.
|
||||
|
||||
Use multiple TBODY sections when rules are needed
|
||||
between groups of table rows.
|
||||
-->
|
||||
<!ATTLIST (THEAD|TBODY|TFOOT) -- table section --
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
%cellhalign; -- horizontal alignment in cells --
|
||||
%cellvalign; -- vertical alignment in cells --
|
||||
>
|
||||
|
||||
<!ATTLIST TR -- table row --
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
%cellhalign; -- horizontal alignment in cells --
|
||||
%cellvalign; -- vertical alignment in cells --
|
||||
>
|
||||
|
||||
|
||||
<!-- Scope is simpler than headers attribute for common tables -->
|
||||
<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
|
||||
|
||||
<!-- TH is for headers, TD for data, but for cells acting as both use TD -->
|
||||
<!ATTLIST (TH|TD) -- header or data cell --
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
abbr %Text; #IMPLIED -- abbreviation for header cell --
|
||||
axis CDATA #IMPLIED -- comma-separated list of related headers--
|
||||
headers IDREFS #IMPLIED -- list of id's for header cells --
|
||||
scope %Scope; #IMPLIED -- scope covered by header cells --
|
||||
rowspan NUMBER 1 -- number of rows spanned by cell --
|
||||
colspan NUMBER 1 -- number of cols spanned by cell --
|
||||
%cellhalign; -- horizontal alignment in cells --
|
||||
%cellvalign; -- vertical alignment in cells --
|
||||
>
|
||||
|
||||
|
||||
<!--================ Document Head =======================================-->
|
||||
<!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT" -->
|
||||
<!ENTITY % head.content "TITLE & BASE?">
|
||||
|
||||
<!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->
|
||||
<!ATTLIST HEAD
|
||||
%i18n; -- lang, dir --
|
||||
profile %URI; #IMPLIED -- named dictionary of meta info --
|
||||
>
|
||||
|
||||
<!-- The TITLE element is not considered part of the flow of text.
|
||||
It should be displayed, for example as the page header or
|
||||
window title. Exactly one title is required per document.
|
||||
-->
|
||||
<!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title -->
|
||||
<!ATTLIST TITLE %i18n>
|
||||
|
||||
|
||||
<!ELEMENT BASE - O EMPTY -- document base URI -->
|
||||
<!ATTLIST BASE
|
||||
href %URI; #REQUIRED -- URI that acts as base URI --
|
||||
>
|
||||
|
||||
<!ELEMENT META - O EMPTY -- generic metainformation -->
|
||||
<!ATTLIST META
|
||||
%i18n; -- lang, dir, for use with content --
|
||||
http-equiv NAME #IMPLIED -- HTTP response header name --
|
||||
name NAME #IMPLIED -- metainformation name --
|
||||
content CDATA #REQUIRED -- associated information --
|
||||
scheme CDATA #IMPLIED -- select form of content --
|
||||
>
|
||||
|
||||
<!ELEMENT STYLE - - %StyleSheet -- style info -->
|
||||
<!ATTLIST STYLE
|
||||
%i18n; -- lang, dir, for use with title --
|
||||
type %ContentType; #REQUIRED -- content type of style language --
|
||||
media %MediaDesc; #IMPLIED -- designed for use with these media --
|
||||
title %Text; #IMPLIED -- advisory title --
|
||||
>
|
||||
|
||||
<!ELEMENT SCRIPT - - %Script; -- script statements -->
|
||||
<!ATTLIST SCRIPT
|
||||
charset %Charset; #IMPLIED -- char encoding of linked resource --
|
||||
type %ContentType; #REQUIRED -- content type of script language --
|
||||
src %URI; #IMPLIED -- URI for an external script --
|
||||
defer (defer) #IMPLIED -- UA may defer execution of script --
|
||||
event CDATA #IMPLIED -- reserved for possible future use --
|
||||
for %URI; #IMPLIED -- reserved for possible future use --
|
||||
>
|
||||
|
||||
<!ELEMENT NOSCRIPT - - (%block;)+
|
||||
-- alternate content container for non script-based rendering -->
|
||||
<!ATTLIST NOSCRIPT
|
||||
%attrs; -- %coreattrs, %i18n, %events --
|
||||
>
|
||||
|
||||
<!--================ Document Structure ==================================-->
|
||||
<!ENTITY % html.content "HEAD, BODY">
|
||||
|
||||
<!ELEMENT HTML O O (%html.content;) -- document root element -->
|
||||
<!ATTLIST HTML
|
||||
%i18n; -- lang, dir --
|
||||
>
|
45
node_modules/sax/examples/switch-bench.js
generated
vendored
Executable file
45
node_modules/sax/examples/switch-bench.js
generated
vendored
Executable file
@ -0,0 +1,45 @@
|
||||
#!/usr/local/bin/node-bench
|
||||
|
||||
var Promise = require("events").Promise;
|
||||
|
||||
var xml = require("posix").cat("test.xml").wait(),
|
||||
path = require("path"),
|
||||
sax = require("../lib/sax"),
|
||||
saxT = require("../lib/sax-trampoline"),
|
||||
|
||||
parser = sax.parser(false, {trim:true}),
|
||||
parserT = saxT.parser(false, {trim:true}),
|
||||
|
||||
sys = require("sys");
|
||||
|
||||
|
||||
var count = exports.stepsPerLap = 500,
|
||||
l = xml.length,
|
||||
runs = 0;
|
||||
exports.countPerLap = 1000;
|
||||
exports.compare = {
|
||||
"switch" : function () {
|
||||
// sys.debug("switch runs: "+runs++);
|
||||
// for (var x = 0; x < l; x += 1000) {
|
||||
// parser.write(xml.substr(x, 1000))
|
||||
// }
|
||||
// for (var i = 0; i < count; i ++) {
|
||||
parser.write(xml);
|
||||
parser.close();
|
||||
// }
|
||||
// done();
|
||||
},
|
||||
trampoline : function () {
|
||||
// sys.debug("trampoline runs: "+runs++);
|
||||
// for (var x = 0; x < l; x += 1000) {
|
||||
// parserT.write(xml.substr(x, 1000))
|
||||
// }
|
||||
// for (var i = 0; i < count; i ++) {
|
||||
parserT.write(xml);
|
||||
parserT.close();
|
||||
// }
|
||||
// done();
|
||||
},
|
||||
};
|
||||
|
||||
sys.debug("rock and roll...");
|
15
node_modules/sax/examples/test.html
generated
vendored
Normal file
15
node_modules/sax/examples/test.html
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<!doctype html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>testing the parser</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>hello
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
1254
node_modules/sax/examples/test.xml
generated
vendored
Normal file
1254
node_modules/sax/examples/test.xml
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2539
node_modules/sax/lib/sax.js
generated
vendored
2539
node_modules/sax/lib/sax.js
generated
vendored
File diff suppressed because it is too large
Load Diff
64
node_modules/sax/package.json
generated
vendored
64
node_modules/sax/package.json
generated
vendored
@ -2,44 +2,46 @@
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "sax@1.1.4",
|
||||
"raw": "sax@0.3.5",
|
||||
"scope": null,
|
||||
"escapedName": "sax",
|
||||
"name": "sax",
|
||||
"rawSpec": "1.1.4",
|
||||
"spec": "1.1.4",
|
||||
"rawSpec": "0.3.5",
|
||||
"spec": "0.3.5",
|
||||
"type": "version"
|
||||
},
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/elementtree"
|
||||
]
|
||||
],
|
||||
"_from": "sax@1.1.4",
|
||||
"_id": "sax@1.1.4",
|
||||
"_defaultsLoaded": true,
|
||||
"_engineSupported": true,
|
||||
"_from": "sax@0.3.5",
|
||||
"_id": "sax@0.3.5",
|
||||
"_inCache": true,
|
||||
"_location": "/sax",
|
||||
"_nodeVersion": "4.0.0",
|
||||
"_nodeVersion": "v0.6.7-pre",
|
||||
"_npmUser": {
|
||||
"name": "isaacs",
|
||||
"email": "isaacs@npmjs.com"
|
||||
"email": "i@izs.me"
|
||||
},
|
||||
"_npmVersion": "3.3.2",
|
||||
"_npmVersion": "1.1.0-beta-7",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "sax@1.1.4",
|
||||
"raw": "sax@0.3.5",
|
||||
"scope": null,
|
||||
"escapedName": "sax",
|
||||
"name": "sax",
|
||||
"rawSpec": "1.1.4",
|
||||
"spec": "1.1.4",
|
||||
"rawSpec": "0.3.5",
|
||||
"spec": "0.3.5",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/elementtree"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/sax/-/sax-1.1.4.tgz",
|
||||
"_shasum": "74b6d33c9ae1e001510f179a91168588f1aedaa9",
|
||||
"_resolved": "http://registry.npmjs.org/sax/-/sax-0.3.5.tgz",
|
||||
"_shasum": "88fcfc1f73c0c8bbd5b7c776b6d3f3501eed073d",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "sax@1.1.4",
|
||||
"_spec": "sax@0.3.5",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/elementtree",
|
||||
"author": {
|
||||
"name": "Isaac Z. Schlueter",
|
||||
@ -81,32 +83,24 @@
|
||||
{
|
||||
"name": "Justin Makeig",
|
||||
"email": "jmpublic@makeig.com"
|
||||
},
|
||||
{
|
||||
"name": "Mike Schilling",
|
||||
"email": "mike@emotive.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "An evented streaming XML parser in JavaScript",
|
||||
"devDependencies": {
|
||||
"standard": "^5.3.1",
|
||||
"tap": "^2.1.1"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "74b6d33c9ae1e001510f179a91168588f1aedaa9",
|
||||
"tarball": "https://registry.npmjs.org/sax/-/sax-1.1.4.tgz"
|
||||
"shasum": "88fcfc1f73c0c8bbd5b7c776b6d3f3501eed073d",
|
||||
"tarball": "https://registry.npmjs.org/sax/-/sax-0.3.5.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"files": [
|
||||
"lib/sax.js",
|
||||
"LICENSE",
|
||||
"LICENSE-W3C.html",
|
||||
"README.md"
|
||||
],
|
||||
"gitHead": "ce6b2a2c20633482eeabb6d39cee734aef2e4da7",
|
||||
"homepage": "https://github.com/isaacs/sax-js#readme",
|
||||
"license": "ISC",
|
||||
"license": {
|
||||
"type": "MIT",
|
||||
"url": "https://raw.github.com/isaacs/sax-js/master/LICENSE"
|
||||
},
|
||||
"main": "lib/sax.js",
|
||||
"maintainers": [
|
||||
{
|
||||
@ -122,9 +116,7 @@
|
||||
"url": "git://github.com/isaacs/sax-js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "standard -F test/*.js lib/*.js",
|
||||
"posttest": "npm run lint",
|
||||
"test": "tap test/*.js"
|
||||
"test": "node test/index.js"
|
||||
},
|
||||
"version": "1.1.4"
|
||||
"version": "0.3.5"
|
||||
}
|
||||
|
25
node_modules/sax/test/buffer-overrun.js
generated
vendored
Normal file
25
node_modules/sax/test/buffer-overrun.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// set this really low so that I don't have to put 64 MB of xml in here.
|
||||
var sax = require("../lib/sax")
|
||||
var bl = sax.MAX_BUFFER_LENGTH
|
||||
sax.MAX_BUFFER_LENGTH = 5;
|
||||
|
||||
require(__dirname).test({
|
||||
expect : [
|
||||
["error", "Max buffer length exceeded: tagName\nLine: 0\nColumn: 15\nChar: "],
|
||||
["error", "Max buffer length exceeded: tagName\nLine: 0\nColumn: 30\nChar: "],
|
||||
["error", "Max buffer length exceeded: tagName\nLine: 0\nColumn: 45\nChar: "],
|
||||
["opentag", {
|
||||
"name": "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||
"attributes": {}
|
||||
}],
|
||||
["text", "yo"],
|
||||
["closetag", "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"]
|
||||
]
|
||||
}).write("<abcdefghijklmn")
|
||||
.write("opqrstuvwxyzABC")
|
||||
.write("DEFGHIJKLMNOPQR")
|
||||
.write("STUVWXYZ>")
|
||||
.write("yo")
|
||||
.write("</abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ>")
|
||||
.close();
|
||||
sax.MAX_BUFFER_LENGTH = bl
|
11
node_modules/sax/test/cdata-chunked.js
generated
vendored
Normal file
11
node_modules/sax/test/cdata-chunked.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
require(__dirname).test({
|
||||
expect : [
|
||||
["opentag", {"name": "R","attributes": {}}],
|
||||
["opencdata", undefined],
|
||||
["cdata", " this is character data "],
|
||||
["closecdata", undefined],
|
||||
["closetag", "R"]
|
||||
]
|
||||
}).write("<r><![CDATA[ this is ").write("character data ").write("]]></r>").close();
|
||||
|
15
node_modules/sax/test/cdata-end-split.js
generated
vendored
Normal file
15
node_modules/sax/test/cdata-end-split.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
require(__dirname).test({
|
||||
expect : [
|
||||
["opentag", {"name": "R","attributes": {}}],
|
||||
["opencdata", undefined],
|
||||
["cdata", " this is "],
|
||||
["closecdata", undefined],
|
||||
["closetag", "R"]
|
||||
]
|
||||
})
|
||||
.write("<r><![CDATA[ this is ]")
|
||||
.write("]>")
|
||||
.write("</r>")
|
||||
.close();
|
||||
|
28
node_modules/sax/test/cdata-fake-end.js
generated
vendored
Normal file
28
node_modules/sax/test/cdata-fake-end.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
var p = require(__dirname).test({
|
||||
expect : [
|
||||
["opentag", {"name": "R","attributes": {}}],
|
||||
["opencdata", undefined],
|
||||
["cdata", "[[[[[[[[]]]]]]]]"],
|
||||
["closecdata", undefined],
|
||||
["closetag", "R"]
|
||||
]
|
||||
})
|
||||
var x = "<r><![CDATA[[[[[[[[[]]]]]]]]]]></r>"
|
||||
for (var i = 0; i < x.length ; i ++) {
|
||||
p.write(x.charAt(i))
|
||||
}
|
||||
p.close();
|
||||
|
||||
|
||||
var p2 = require(__dirname).test({
|
||||
expect : [
|
||||
["opentag", {"name": "R","attributes": {}}],
|
||||
["opencdata", undefined],
|
||||
["cdata", "[[[[[[[[]]]]]]]]"],
|
||||
["closecdata", undefined],
|
||||
["closetag", "R"]
|
||||
]
|
||||
})
|
||||
var x = "<r><![CDATA[[[[[[[[[]]]]]]]]]]></r>"
|
||||
p2.write(x).close();
|
15
node_modules/sax/test/cdata-multiple.js
generated
vendored
Normal file
15
node_modules/sax/test/cdata-multiple.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
require(__dirname).test({
|
||||
expect : [
|
||||
["opentag", {"name": "R","attributes": {}}],
|
||||
["opencdata", undefined],
|
||||
["cdata", " this is "],
|
||||
["closecdata", undefined],
|
||||
["opencdata", undefined],
|
||||
["cdata", "character data "],
|
||||
["closecdata", undefined],
|
||||
["closetag", "R"]
|
||||
]
|
||||
}).write("<r><![CDATA[ this is ]]>").write("<![CDA").write("T").write("A[")
|
||||
.write("character data ").write("]]></r>").close();
|
||||
|
10
node_modules/sax/test/cdata.js
generated
vendored
Normal file
10
node_modules/sax/test/cdata.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
require(__dirname).test({
|
||||
xml : "<r><![CDATA[ this is character data ]]></r>",
|
||||
expect : [
|
||||
["opentag", {"name": "R","attributes": {}}],
|
||||
["opencdata", undefined],
|
||||
["cdata", " this is character data "],
|
||||
["closecdata", undefined],
|
||||
["closetag", "R"]
|
||||
]
|
||||
});
|
86
node_modules/sax/test/index.js
generated
vendored
Normal file
86
node_modules/sax/test/index.js
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
var globalsBefore = JSON.stringify(Object.keys(global))
|
||||
, util = require("util")
|
||||
, assert = require("assert")
|
||||
, fs = require("fs")
|
||||
, path = require("path")
|
||||
, sax = require("../lib/sax")
|
||||
|
||||
exports.sax = sax
|
||||
|
||||
// handy way to do simple unit tests
|
||||
// if the options contains an xml string, it'll be written and the parser closed.
|
||||
// otherwise, it's assumed that the test will write and close.
|
||||
exports.test = function test (options) {
|
||||
var xml = options.xml
|
||||
, parser = sax.parser(options.strict, options.opt)
|
||||
, expect = options.expect
|
||||
, e = 0
|
||||
sax.EVENTS.forEach(function (ev) {
|
||||
parser["on" + ev] = function (n) {
|
||||
if (process.env.DEBUG) {
|
||||
console.error({ expect: expect[e]
|
||||
, actual: [ev, n] })
|
||||
}
|
||||
if (e >= expect.length && (ev === "end" || ev === "ready")) return
|
||||
assert.ok( e < expect.length,
|
||||
"expectation #"+e+" "+util.inspect(expect[e])+"\n"+
|
||||
"Unexpected event: "+ev+" "+(n ? util.inspect(n) : ""))
|
||||
var inspected = n instanceof Error ? "\n"+ n.message : util.inspect(n)
|
||||
assert.equal(ev, expect[e][0],
|
||||
"expectation #"+e+"\n"+
|
||||
"Didn't get expected event\n"+
|
||||
"expect: "+expect[e][0] + " " +util.inspect(expect[e][1])+"\n"+
|
||||
"actual: "+ev+" "+inspected+"\n")
|
||||
if (ev === "error") assert.equal(n.message, expect[e][1])
|
||||
else assert.deepEqual(n, expect[e][1],
|
||||
"expectation #"+e+"\n"+
|
||||
"Didn't get expected argument\n"+
|
||||
"expect: "+expect[e][0] + " " +util.inspect(expect[e][1])+"\n"+
|
||||
"actual: "+ev+" "+inspected+"\n")
|
||||
e++
|
||||
if (ev === "error") parser.resume()
|
||||
}
|
||||
})
|
||||
if (xml) parser.write(xml).close()
|
||||
return parser
|
||||
}
|
||||
|
||||
if (module === require.main) {
|
||||
var running = true
|
||||
, failures = 0
|
||||
|
||||
function fail (file, er) {
|
||||
util.error("Failed: "+file)
|
||||
util.error(er.stack || er.message)
|
||||
failures ++
|
||||
}
|
||||
|
||||
fs.readdir(__dirname, function (error, files) {
|
||||
files = files.filter(function (file) {
|
||||
return (/\.js$/.exec(file) && file !== 'index.js')
|
||||
})
|
||||
var n = files.length
|
||||
, i = 0
|
||||
console.log("0.." + n)
|
||||
files.forEach(function (file) {
|
||||
// run this test.
|
||||
try {
|
||||
require(path.resolve(__dirname, file))
|
||||
var globalsAfter = JSON.stringify(Object.keys(global))
|
||||
if (globalsAfter !== globalsBefore) {
|
||||
var er = new Error("new globals introduced\n"+
|
||||
"expected: "+globalsBefore+"\n"+
|
||||
"actual: "+globalsAfter)
|
||||
globalsBefore = globalsAfter
|
||||
throw er
|
||||
}
|
||||
console.log("ok " + (++i) + " - " + file)
|
||||
} catch (er) {
|
||||
console.log("not ok "+ (++i) + " - " + file)
|
||||
fail(file, er)
|
||||
}
|
||||
})
|
||||
if (!failures) return console.log("#all pass")
|
||||
else return console.error(failures + " failure" + (failures > 1 ? "s" : ""))
|
||||
})
|
||||
}
|
43
node_modules/sax/test/issue-23.js
generated
vendored
Normal file
43
node_modules/sax/test/issue-23.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
require(__dirname).test
|
||||
( { xml :
|
||||
"<compileClassesResponse>"+
|
||||
"<result>"+
|
||||
"<bodyCrc>653724009</bodyCrc>"+
|
||||
"<column>-1</column>"+
|
||||
"<id>01pG0000002KoSUIA0</id>"+
|
||||
"<line>-1</line>"+
|
||||
"<name>CalendarController</name>"+
|
||||
"<success>true</success>"+
|
||||
"</result>"+
|
||||
"</compileClassesResponse>"
|
||||
|
||||
, expect :
|
||||
[ [ "opentag", { name: "COMPILECLASSESRESPONSE", attributes: {} } ]
|
||||
, [ "opentag", { name : "RESULT", attributes: {} } ]
|
||||
, [ "opentag", { name: "BODYCRC", attributes: {} } ]
|
||||
, [ "text", "653724009" ]
|
||||
, [ "closetag", "BODYCRC" ]
|
||||
, [ "opentag", { name: "COLUMN", attributes: {} } ]
|
||||
, [ "text", "-1" ]
|
||||
, [ "closetag", "COLUMN" ]
|
||||
, [ "opentag", { name: "ID", attributes: {} } ]
|
||||
, [ "text", "01pG0000002KoSUIA0" ]
|
||||
, [ "closetag", "ID" ]
|
||||
, [ "opentag", {name: "LINE", attributes: {} } ]
|
||||
, [ "text", "-1" ]
|
||||
, [ "closetag", "LINE" ]
|
||||
, [ "opentag", {name: "NAME", attributes: {} } ]
|
||||
, [ "text", "CalendarController" ]
|
||||
, [ "closetag", "NAME" ]
|
||||
, [ "opentag", {name: "SUCCESS", attributes: {} } ]
|
||||
, [ "text", "true" ]
|
||||
, [ "closetag", "SUCCESS" ]
|
||||
, [ "closetag", "RESULT" ]
|
||||
, [ "closetag", "COMPILECLASSESRESPONSE" ]
|
||||
]
|
||||
, strict : false
|
||||
, opt : {}
|
||||
}
|
||||
)
|
||||
|
24
node_modules/sax/test/issue-30.js
generated
vendored
Normal file
24
node_modules/sax/test/issue-30.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// https://github.com/isaacs/sax-js/issues/33
|
||||
require(__dirname).test
|
||||
( { xml : "<xml>\n"+
|
||||
"<!-- \n"+
|
||||
" comment with a single dash- in it\n"+
|
||||
"-->\n"+
|
||||
"<data/>\n"+
|
||||
"</xml>"
|
||||
|
||||
, expect :
|
||||
[ [ "opentag", { name: "xml", attributes: {} } ]
|
||||
, [ "text", "\n" ]
|
||||
, [ "comment", " \n comment with a single dash- in it\n" ]
|
||||
, [ "text", "\n" ]
|
||||
, [ "opentag", { name: "data", attributes: {} } ]
|
||||
, [ "closetag", "data" ]
|
||||
, [ "text", "\n" ]
|
||||
, [ "closetag", "xml" ]
|
||||
]
|
||||
, strict : true
|
||||
, opt : {}
|
||||
}
|
||||
)
|
||||
|
15
node_modules/sax/test/issue-35.js
generated
vendored
Normal file
15
node_modules/sax/test/issue-35.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
// https://github.com/isaacs/sax-js/issues/35
|
||||
require(__dirname).test
|
||||
( { xml : "<xml>

\n"+
|
||||
"</xml>"
|
||||
|
||||
, expect :
|
||||
[ [ "opentag", { name: "xml", attributes: {} } ]
|
||||
, [ "text", "\r\r\n" ]
|
||||
, [ "closetag", "xml" ]
|
||||
]
|
||||
, strict : true
|
||||
, opt : {}
|
||||
}
|
||||
)
|
||||
|
13
node_modules/sax/test/issue-47.js
generated
vendored
Normal file
13
node_modules/sax/test/issue-47.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// https://github.com/isaacs/sax-js/issues/47
|
||||
require(__dirname).test
|
||||
( { xml : '<a href="query.svc?x=1&y=2&z=3"/>'
|
||||
, expect : [
|
||||
[ "attribute", { name:'href', value:"query.svc?x=1&y=2&z=3"} ],
|
||||
[ "opentag", { name: "a", attributes: { href:"query.svc?x=1&y=2&z=3"} } ],
|
||||
[ "closetag", "a" ]
|
||||
]
|
||||
, strict : true
|
||||
, opt : {}
|
||||
}
|
||||
)
|
||||
|
31
node_modules/sax/test/issue-49.js
generated
vendored
Normal file
31
node_modules/sax/test/issue-49.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// https://github.com/isaacs/sax-js/issues/49
|
||||
require(__dirname).test
|
||||
( { xml : "<xml><script>hello world</script></xml>"
|
||||
, expect :
|
||||
[ [ "opentag", { name: "xml", attributes: {} } ]
|
||||
, [ "opentag", { name: "script", attributes: {} } ]
|
||||
, [ "text", "hello world" ]
|
||||
, [ "closetag", "script" ]
|
||||
, [ "closetag", "xml" ]
|
||||
]
|
||||
, strict : false
|
||||
, opt : { lowercasetags: true, noscript: true }
|
||||
}
|
||||
)
|
||||
|
||||
require(__dirname).test
|
||||
( { xml : "<xml><script><![CDATA[hello world]]></script></xml>"
|
||||
, expect :
|
||||
[ [ "opentag", { name: "xml", attributes: {} } ]
|
||||
, [ "opentag", { name: "script", attributes: {} } ]
|
||||
, [ "opencdata", undefined ]
|
||||
, [ "cdata", "hello world" ]
|
||||
, [ "closecdata", undefined ]
|
||||
, [ "closetag", "script" ]
|
||||
, [ "closetag", "xml" ]
|
||||
]
|
||||
, strict : false
|
||||
, opt : { lowercasetags: true, noscript: true }
|
||||
}
|
||||
)
|
||||
|
28
node_modules/sax/test/parser-position.js
generated
vendored
Normal file
28
node_modules/sax/test/parser-position.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
var sax = require("../lib/sax"),
|
||||
assert = require("assert")
|
||||
|
||||
function testPosition(chunks, expectedEvents) {
|
||||
var parser = sax.parser();
|
||||
expectedEvents.forEach(function(expectation) {
|
||||
parser['on' + expectation[0]] = function() {
|
||||
for (var prop in expectation[1]) {
|
||||
assert.equal(parser[prop], expectation[1][prop]);
|
||||
}
|
||||
}
|
||||
});
|
||||
chunks.forEach(function(chunk) {
|
||||
parser.write(chunk);
|
||||
});
|
||||
};
|
||||
|
||||
testPosition(['<div>abcdefgh</div>'],
|
||||
[ ['opentag', { position: 5, startTagPosition: 1 }]
|
||||
, ['text', { position: 19, startTagPosition: 14 }]
|
||||
, ['closetag', { position: 19, startTagPosition: 14 }]
|
||||
]);
|
||||
|
||||
testPosition(['<div>abcde','fgh</div>'],
|
||||
[ ['opentag', { position: 5, startTagPosition: 1 }]
|
||||
, ['text', { position: 19, startTagPosition: 14 }]
|
||||
, ['closetag', { position: 19, startTagPosition: 14 }]
|
||||
]);
|
12
node_modules/sax/test/script.js
generated
vendored
Normal file
12
node_modules/sax/test/script.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
require(__dirname).test({
|
||||
xml : "<html><head><script>if (1 < 0) { console.log('elo there'); }</script></head></html>",
|
||||
expect : [
|
||||
["opentag", {"name": "HTML","attributes": {}}],
|
||||
["opentag", {"name": "HEAD","attributes": {}}],
|
||||
["opentag", {"name": "SCRIPT","attributes": {}}],
|
||||
["script", "if (1 < 0) { console.log('elo there'); }"],
|
||||
["closetag", "SCRIPT"],
|
||||
["closetag", "HEAD"],
|
||||
["closetag", "HTML"]
|
||||
]
|
||||
});
|
40
node_modules/sax/test/self-closing-child-strict.js
generated
vendored
Normal file
40
node_modules/sax/test/self-closing-child-strict.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
require(__dirname).test({
|
||||
xml :
|
||||
"<root>"+
|
||||
"<child>" +
|
||||
"<haha />" +
|
||||
"</child>" +
|
||||
"<monkey>" +
|
||||
"=(|)" +
|
||||
"</monkey>" +
|
||||
"</root>",
|
||||
expect : [
|
||||
["opentag", {
|
||||
"name": "root",
|
||||
"attributes": {}
|
||||
}],
|
||||
["opentag", {
|
||||
"name": "child",
|
||||
"attributes": {}
|
||||
}],
|
||||
["opentag", {
|
||||
"name": "haha",
|
||||
"attributes": {}
|
||||
}],
|
||||
["closetag", "haha"],
|
||||
["closetag", "child"],
|
||||
["opentag", {
|
||||
"name": "monkey",
|
||||
"attributes": {}
|
||||
}],
|
||||
["text", "=(|)"],
|
||||
["closetag", "monkey"],
|
||||
["closetag", "root"],
|
||||
["end"],
|
||||
["ready"]
|
||||
],
|
||||
strict : true,
|
||||
opt : {}
|
||||
});
|
||||
|
40
node_modules/sax/test/self-closing-child.js
generated
vendored
Normal file
40
node_modules/sax/test/self-closing-child.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
require(__dirname).test({
|
||||
xml :
|
||||
"<root>"+
|
||||
"<child>" +
|
||||
"<haha />" +
|
||||
"</child>" +
|
||||
"<monkey>" +
|
||||
"=(|)" +
|
||||
"</monkey>" +
|
||||
"</root>",
|
||||
expect : [
|
||||
["opentag", {
|
||||
"name": "ROOT",
|
||||
"attributes": {}
|
||||
}],
|
||||
["opentag", {
|
||||
"name": "CHILD",
|
||||
"attributes": {}
|
||||
}],
|
||||
["opentag", {
|
||||
"name": "HAHA",
|
||||
"attributes": {}
|
||||
}],
|
||||
["closetag", "HAHA"],
|
||||
["closetag", "CHILD"],
|
||||
["opentag", {
|
||||
"name": "MONKEY",
|
||||
"attributes": {}
|
||||
}],
|
||||
["text", "=(|)"],
|
||||
["closetag", "MONKEY"],
|
||||
["closetag", "ROOT"],
|
||||
["end"],
|
||||
["ready"]
|
||||
],
|
||||
strict : false,
|
||||
opt : {}
|
||||
});
|
||||
|
25
node_modules/sax/test/self-closing-tag.js
generated
vendored
Normal file
25
node_modules/sax/test/self-closing-tag.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
require(__dirname).test({
|
||||
xml :
|
||||
"<root> "+
|
||||
"<haha /> "+
|
||||
"<haha/> "+
|
||||
"<monkey> "+
|
||||
"=(|) "+
|
||||
"</monkey>"+
|
||||
"</root> ",
|
||||
expect : [
|
||||
["opentag", {name:"ROOT", attributes:{}}],
|
||||
["opentag", {name:"HAHA", attributes:{}}],
|
||||
["closetag", "HAHA"],
|
||||
["opentag", {name:"HAHA", attributes:{}}],
|
||||
["closetag", "HAHA"],
|
||||
// ["opentag", {name:"HAHA", attributes:{}}],
|
||||
// ["closetag", "HAHA"],
|
||||
["opentag", {name:"MONKEY", attributes:{}}],
|
||||
["text", "=(|)"],
|
||||
["closetag", "MONKEY"],
|
||||
["closetag", "ROOT"]
|
||||
],
|
||||
opt : { trim : true }
|
||||
});
|
17
node_modules/sax/test/stray-ending.js
generated
vendored
Normal file
17
node_modules/sax/test/stray-ending.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// stray ending tags should just be ignored in non-strict mode.
|
||||
// https://github.com/isaacs/sax-js/issues/32
|
||||
require(__dirname).test
|
||||
( { xml :
|
||||
"<a><b></c></b></a>"
|
||||
, expect :
|
||||
[ [ "opentag", { name: "A", attributes: {} } ]
|
||||
, [ "opentag", { name: "B", attributes: {} } ]
|
||||
, [ "text", "</c>" ]
|
||||
, [ "closetag", "B" ]
|
||||
, [ "closetag", "A" ]
|
||||
]
|
||||
, strict : false
|
||||
, opt : {}
|
||||
}
|
||||
)
|
||||
|
17
node_modules/sax/test/trailing-non-whitespace.js
generated
vendored
Normal file
17
node_modules/sax/test/trailing-non-whitespace.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
require(__dirname).test({
|
||||
xml : "<span>Welcome,</span> to monkey land",
|
||||
expect : [
|
||||
["opentag", {
|
||||
"name": "SPAN",
|
||||
"attributes": {}
|
||||
}],
|
||||
["text", "Welcome,"],
|
||||
["closetag", "SPAN"],
|
||||
["text", " to monkey land"],
|
||||
["end"],
|
||||
["ready"]
|
||||
],
|
||||
strict : false,
|
||||
opt : {}
|
||||
});
|
17
node_modules/sax/test/unquoted.js
generated
vendored
Normal file
17
node_modules/sax/test/unquoted.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// unquoted attributes should be ok in non-strict mode
|
||||
// https://github.com/isaacs/sax-js/issues/31
|
||||
require(__dirname).test
|
||||
( { xml :
|
||||
"<span class=test hello=world></span>"
|
||||
, expect :
|
||||
[ [ "attribute", { name: "class", value: "test" } ]
|
||||
, [ "attribute", { name: "hello", value: "world" } ]
|
||||
, [ "opentag", { name: "SPAN",
|
||||
attributes: { class: "test", hello: "world" } } ]
|
||||
, [ "closetag", "SPAN" ]
|
||||
]
|
||||
, strict : false
|
||||
, opt : {}
|
||||
}
|
||||
)
|
||||
|
67
node_modules/sax/test/xmlns-issue-41.js
generated
vendored
Normal file
67
node_modules/sax/test/xmlns-issue-41.js
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
var t = require(__dirname)
|
||||
|
||||
, xmls = // should be the same both ways.
|
||||
[ "<parent xmlns:a='http://ATTRIBUTE' a:attr='value' />"
|
||||
, "<parent a:attr='value' xmlns:a='http://ATTRIBUTE' />" ]
|
||||
|
||||
, ex1 =
|
||||
[ [ "opennamespace"
|
||||
, { prefix: "a"
|
||||
, uri: "http://ATTRIBUTE"
|
||||
}
|
||||
]
|
||||
, [ "attribute"
|
||||
, { name: "xmlns:a"
|
||||
, value: "http://ATTRIBUTE"
|
||||
, prefix: "xmlns"
|
||||
, local: "a"
|
||||
, uri: "http://www.w3.org/2000/xmlns/"
|
||||
}
|
||||
]
|
||||
, [ "attribute"
|
||||
, { name: "a:attr"
|
||||
, local: "attr"
|
||||
, prefix: "a"
|
||||
, uri: "http://ATTRIBUTE"
|
||||
, value: "value"
|
||||
}
|
||||
]
|
||||
, [ "opentag"
|
||||
, { name: "parent"
|
||||
, uri: ""
|
||||
, prefix: ""
|
||||
, local: "parent"
|
||||
, attributes:
|
||||
{ "a:attr":
|
||||
{ name: "a:attr"
|
||||
, local: "attr"
|
||||
, prefix: "a"
|
||||
, uri: "http://ATTRIBUTE"
|
||||
, value: "value"
|
||||
}
|
||||
, "xmlns:a":
|
||||
{ name: "xmlns:a"
|
||||
, local: "a"
|
||||
, prefix: "xmlns"
|
||||
, uri: "http://www.w3.org/2000/xmlns/"
|
||||
, value: "http://ATTRIBUTE"
|
||||
}
|
||||
}
|
||||
, ns: {"a": "http://ATTRIBUTE"}
|
||||
}
|
||||
]
|
||||
, ["closetag", "parent"]
|
||||
, ["closenamespace", { prefix: "a", uri: "http://ATTRIBUTE" }]
|
||||
]
|
||||
|
||||
// swap the order of elements 2 and 1
|
||||
, ex2 = [ex1[0], ex1[2], ex1[1]].concat(ex1.slice(3))
|
||||
, expected = [ex1, ex2]
|
||||
|
||||
xmls.forEach(function (x, i) {
|
||||
t.test({ xml: x
|
||||
, expect: expected[i]
|
||||
, strict: true
|
||||
, opt: { xmlns: true }
|
||||
})
|
||||
})
|
59
node_modules/sax/test/xmlns-rebinding.js
generated
vendored
Normal file
59
node_modules/sax/test/xmlns-rebinding.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
|
||||
require(__dirname).test
|
||||
( { xml :
|
||||
"<root xmlns:x='x1' xmlns:y='y1' x:a='x1' y:a='y1'>"+
|
||||
"<rebind xmlns:x='x2'>"+
|
||||
"<check x:a='x2' y:a='y1'/>"+
|
||||
"</rebind>"+
|
||||
"<check x:a='x1' y:a='y1'/>"+
|
||||
"</root>"
|
||||
|
||||
, expect :
|
||||
[ [ "opennamespace", { prefix: "x", uri: "x1" } ]
|
||||
, [ "opennamespace", { prefix: "y", uri: "y1" } ]
|
||||
, [ "attribute", { name: "xmlns:x", value: "x1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" } ]
|
||||
, [ "attribute", { name: "xmlns:y", value: "y1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "y" } ]
|
||||
, [ "attribute", { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" } ]
|
||||
, [ "attribute", { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } ]
|
||||
, [ "opentag", { name: "root", uri: "", prefix: "", local: "root",
|
||||
attributes: { "xmlns:x": { name: "xmlns:x", value: "x1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" }
|
||||
, "xmlns:y": { name: "xmlns:y", value: "y1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "y" }
|
||||
, "x:a": { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" }
|
||||
, "y:a": { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } },
|
||||
ns: { x: 'x1', y: 'y1' } } ]
|
||||
|
||||
, [ "opennamespace", { prefix: "x", uri: "x2" } ]
|
||||
, [ "attribute", { name: "xmlns:x", value: "x2", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" } ]
|
||||
, [ "opentag", { name: "rebind", uri: "", prefix: "", local: "rebind",
|
||||
attributes: { "xmlns:x": { name: "xmlns:x", value: "x2", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" } },
|
||||
ns: { x: 'x2' } } ]
|
||||
|
||||
, [ "attribute", { name: "x:a", value: "x2", uri: "x2", prefix: "x", local: "a" } ]
|
||||
, [ "attribute", { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } ]
|
||||
, [ "opentag", { name: "check", uri: "", prefix: "", local: "check",
|
||||
attributes: { "x:a": { name: "x:a", value: "x2", uri: "x2", prefix: "x", local: "a" }
|
||||
, "y:a": { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } },
|
||||
ns: { x: 'x2' } } ]
|
||||
|
||||
, [ "closetag", "check" ]
|
||||
|
||||
, [ "closetag", "rebind" ]
|
||||
, [ "closenamespace", { prefix: "x", uri: "x2" } ]
|
||||
|
||||
, [ "attribute", { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" } ]
|
||||
, [ "attribute", { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } ]
|
||||
, [ "opentag", { name: "check", uri: "", prefix: "", local: "check",
|
||||
attributes: { "x:a": { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" }
|
||||
, "y:a": { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } },
|
||||
ns: { x: 'x1', y: 'y1' } } ]
|
||||
, [ "closetag", "check" ]
|
||||
|
||||
, [ "closetag", "root" ]
|
||||
, [ "closenamespace", { prefix: "x", uri: "x1" } ]
|
||||
, [ "closenamespace", { prefix: "y", uri: "y1" } ]
|
||||
]
|
||||
, strict : true
|
||||
, opt : { xmlns: true }
|
||||
}
|
||||
)
|
||||
|
71
node_modules/sax/test/xmlns-strict.js
generated
vendored
Normal file
71
node_modules/sax/test/xmlns-strict.js
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
|
||||
require(__dirname).test
|
||||
( { xml :
|
||||
"<root>"+
|
||||
"<plain attr='normal'/>"+
|
||||
"<ns1 xmlns='uri:default'>"+
|
||||
"<plain attr='normal'/>"+
|
||||
"</ns1>"+
|
||||
"<ns2 xmlns:a='uri:nsa'>"+
|
||||
"<plain attr='normal'/>"+
|
||||
"<a:ns a:attr='namespaced'/>"+
|
||||
"</ns2>"+
|
||||
"</root>"
|
||||
|
||||
, expect :
|
||||
[ [ "opentag", { name: "root", prefix: "", local: "root", uri: "",
|
||||
attributes: {}, ns: {} } ]
|
||||
|
||||
, [ "attribute", { name: "attr", value: "normal", prefix: "", local: "attr", uri: "" } ]
|
||||
, [ "opentag", { name: "plain", prefix: "", local: "plain", uri: "",
|
||||
attributes: { "attr": { name: "attr", value: "normal", uri: "", prefix: "", local: "attr", uri: "" } },
|
||||
ns: {} } ]
|
||||
, [ "closetag", "plain" ]
|
||||
|
||||
, [ "opennamespace", { prefix: "", uri: "uri:default" } ]
|
||||
|
||||
, [ "attribute", { name: "xmlns", value: "uri:default", prefix: "xmlns", local: "", uri: "http://www.w3.org/2000/xmlns/" } ]
|
||||
, [ "opentag", { name: "ns1", prefix: "", local: "ns1", uri: "uri:default",
|
||||
attributes: { "xmlns": { name: "xmlns", value: "uri:default", prefix: "xmlns", local: "", uri: "http://www.w3.org/2000/xmlns/" } },
|
||||
ns: { "": "uri:default" } } ]
|
||||
|
||||
, [ "attribute", { name: "attr", value: "normal", prefix: "", local: "attr", uri: "uri:default" } ]
|
||||
, [ "opentag", { name: "plain", prefix: "", local: "plain", uri: "uri:default", ns: { '': 'uri:default' },
|
||||
attributes: { "attr": { name: "attr", value: "normal", prefix: "", local: "attr", uri: "uri:default" } } } ]
|
||||
, [ "closetag", "plain" ]
|
||||
|
||||
, [ "closetag", "ns1" ]
|
||||
|
||||
, [ "closenamespace", { prefix: "", uri: "uri:default" } ]
|
||||
|
||||
, [ "opennamespace", { prefix: "a", uri: "uri:nsa" } ]
|
||||
|
||||
, [ "attribute", { name: "xmlns:a", value: "uri:nsa", prefix: "xmlns", local: "a", uri: "http://www.w3.org/2000/xmlns/" } ]
|
||||
|
||||
, [ "opentag", { name: "ns2", prefix: "", local: "ns2", uri: "",
|
||||
attributes: { "xmlns:a": { name: "xmlns:a", value: "uri:nsa", prefix: "xmlns", local: "a", uri: "http://www.w3.org/2000/xmlns/" } },
|
||||
ns: { a: "uri:nsa" } } ]
|
||||
|
||||
, [ "attribute", { name: "attr", value: "normal", prefix: "", local: "attr", uri: "" } ]
|
||||
, [ "opentag", { name: "plain", prefix: "", local: "plain", uri: "",
|
||||
attributes: { "attr": { name: "attr", value: "normal", prefix: "", local: "attr", uri: "" } },
|
||||
ns: { a: 'uri:nsa' } } ]
|
||||
, [ "closetag", "plain" ]
|
||||
|
||||
, [ "attribute", { name: "a:attr", value: "namespaced", prefix: "a", local: "attr", uri: "uri:nsa" } ]
|
||||
, [ "opentag", { name: "a:ns", prefix: "a", local: "ns", uri: "uri:nsa",
|
||||
attributes: { "a:attr": { name: "a:attr", value: "namespaced", prefix: "a", local: "attr", uri: "uri:nsa" } },
|
||||
ns: { a: 'uri:nsa' } } ]
|
||||
, [ "closetag", "a:ns" ]
|
||||
|
||||
, [ "closetag", "ns2" ]
|
||||
|
||||
, [ "closenamespace", { prefix: "a", uri: "uri:nsa" } ]
|
||||
|
||||
, [ "closetag", "root" ]
|
||||
]
|
||||
, strict : true
|
||||
, opt : { xmlns: true }
|
||||
}
|
||||
)
|
||||
|
15
node_modules/sax/test/xmlns-unbound.js
generated
vendored
Normal file
15
node_modules/sax/test/xmlns-unbound.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
require(__dirname).test(
|
||||
{ strict : true
|
||||
, opt : { xmlns: true }
|
||||
, expect :
|
||||
[ ["error", "Unbound namespace prefix: \"unbound\"\nLine: 0\nColumn: 28\nChar: >"]
|
||||
|
||||
, [ "attribute", { name: "unbound:attr", value: "value", uri: "unbound", prefix: "unbound", local: "attr" } ]
|
||||
, [ "opentag", { name: "root", uri: "", prefix: "", local: "root",
|
||||
attributes: { "unbound:attr": { name: "unbound:attr", value: "value", uri: "unbound", prefix: "unbound", local: "attr" } },
|
||||
ns: {} } ]
|
||||
, [ "closetag", "root" ]
|
||||
]
|
||||
}
|
||||
).write("<root unbound:attr='value'/>")
|
35
node_modules/sax/test/xmlns-xml-default-prefix-attribute.js
generated
vendored
Normal file
35
node_modules/sax/test/xmlns-xml-default-prefix-attribute.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
require(__dirname).test(
|
||||
{ xml : "<root xml:lang='en'/>"
|
||||
, expect :
|
||||
[ [ "attribute"
|
||||
, { name: "xml:lang"
|
||||
, local: "lang"
|
||||
, prefix: "xml"
|
||||
, uri: "http://www.w3.org/XML/1998/namespace"
|
||||
, value: "en"
|
||||
}
|
||||
]
|
||||
, [ "opentag"
|
||||
, { name: "root"
|
||||
, uri: ""
|
||||
, prefix: ""
|
||||
, local: "root"
|
||||
, attributes:
|
||||
{ "xml:lang":
|
||||
{ name: "xml:lang"
|
||||
, local: "lang"
|
||||
, prefix: "xml"
|
||||
, uri: "http://www.w3.org/XML/1998/namespace"
|
||||
, value: "en"
|
||||
}
|
||||
}
|
||||
, ns: {}
|
||||
}
|
||||
]
|
||||
, ["closetag", "root"]
|
||||
]
|
||||
, strict : true
|
||||
, opt : { xmlns: true }
|
||||
}
|
||||
)
|
||||
|
20
node_modules/sax/test/xmlns-xml-default-prefix.js
generated
vendored
Normal file
20
node_modules/sax/test/xmlns-xml-default-prefix.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
require(__dirname).test(
|
||||
{ xml : "<xml:root/>"
|
||||
, expect :
|
||||
[
|
||||
[ "opentag"
|
||||
, { name: "xml:root"
|
||||
, uri: "http://www.w3.org/XML/1998/namespace"
|
||||
, prefix: "xml"
|
||||
, local: "root"
|
||||
, attributes: {}
|
||||
, ns: {}
|
||||
}
|
||||
]
|
||||
, ["closetag", "xml:root"]
|
||||
]
|
||||
, strict : true
|
||||
, opt : { xmlns: true }
|
||||
}
|
||||
)
|
||||
|
40
node_modules/sax/test/xmlns-xml-default-redefine.js
generated
vendored
Normal file
40
node_modules/sax/test/xmlns-xml-default-redefine.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
require(__dirname).test(
|
||||
{ xml : "<xml:root xmlns:xml='ERROR'/>"
|
||||
, expect :
|
||||
[ ["error"
|
||||
, "xml: prefix must be bound to http://www.w3.org/XML/1998/namespace\n"
|
||||
+ "Actual: ERROR\n"
|
||||
+ "Line: 0\nColumn: 27\nChar: '"
|
||||
]
|
||||
, [ "attribute"
|
||||
, { name: "xmlns:xml"
|
||||
, local: "xml"
|
||||
, prefix: "xmlns"
|
||||
, uri: "http://www.w3.org/2000/xmlns/"
|
||||
, value: "ERROR"
|
||||
}
|
||||
]
|
||||
, [ "opentag"
|
||||
, { name: "xml:root"
|
||||
, uri: "http://www.w3.org/XML/1998/namespace"
|
||||
, prefix: "xml"
|
||||
, local: "root"
|
||||
, attributes:
|
||||
{ "xmlns:xml":
|
||||
{ name: "xmlns:xml"
|
||||
, local: "xml"
|
||||
, prefix: "xmlns"
|
||||
, uri: "http://www.w3.org/2000/xmlns/"
|
||||
, value: "ERROR"
|
||||
}
|
||||
}
|
||||
, ns: {}
|
||||
}
|
||||
]
|
||||
, ["closetag", "xml:root"]
|
||||
]
|
||||
, strict : true
|
||||
, opt : { xmlns: true }
|
||||
}
|
||||
)
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cordova-android",
|
||||
"version": "6.2.0",
|
||||
"version": "6.2.3",
|
||||
"description": "cordova-android release",
|
||||
"bin": {
|
||||
"create": "bin/create"
|
||||
@ -25,7 +25,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"cordova-common": "^2.0.1",
|
||||
"elementtree": "^0.1.6",
|
||||
"elementtree": "0.1.6",
|
||||
"nopt": "^3.0.1",
|
||||
"properties-parser": "^0.2.3",
|
||||
"q": "^1.4.1",
|
||||
|
7
spec/fixtures/sdk25.3-avdmanager_list_target.txt
vendored
Normal file
7
spec/fixtures/sdk25.3-avdmanager_list_target.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
Available Android targets:
|
||||
----------
|
||||
id: 1 or "android-25"
|
||||
Name: Android API 25
|
||||
Type: Platform
|
||||
API level: 25
|
||||
Revision: 3
|
1137
spec/fixtures/sdkmanager_list.txt
vendored
1137
spec/fixtures/sdkmanager_list.txt
vendored
File diff suppressed because it is too large
Load Diff
@ -26,10 +26,16 @@ var Q = require("q");
|
||||
|
||||
describe("android_sdk", function () {
|
||||
describe("list_targets_with_android", function() {
|
||||
it("should invoke `android` with the `list target` command and _not_ the `list targets` command, as the plural form is not supported in some Android SDK Tools versions", function() {
|
||||
var deferred = Q.defer();
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
android_sdk.list_targets_with_android();
|
||||
expect(superspawn.spawn).toHaveBeenCalledWith("android", ["list", "target"]);
|
||||
});
|
||||
it("should parse and return results from `android list targets` command", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "android_list_targets.txt"), "utf-8"));
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.2-android_list_targets.txt"), "utf-8"));
|
||||
return android_sdk.list_targets_with_android()
|
||||
.then(function(list) {
|
||||
[ "Google Inc.:Google APIs:23",
|
||||
@ -53,26 +59,14 @@ describe("android_sdk", function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
describe("list_targets_with_sdkmanager", function() {
|
||||
it("should parse and return results from `sdkmanager --list` command", function(done) {
|
||||
describe("list_targets_with_avdmanager", function() {
|
||||
it("should parse and return results from `avdmanager list target` command", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdkmanager_list.txt"), "utf-8"));
|
||||
return android_sdk.list_targets_with_sdkmanager()
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.3-avdmanager_list_target.txt"), "utf-8"));
|
||||
return android_sdk.list_targets_with_avdmanager()
|
||||
.then(function(list) {
|
||||
[ "Google Inc.:Google APIs:19",
|
||||
"Google Inc.:Google APIs:21",
|
||||
"Google Inc.:Google APIs:22",
|
||||
"Google Inc.:Google APIs:23",
|
||||
"Google Inc.:Google APIs:24",
|
||||
"android-19",
|
||||
"android-21",
|
||||
"android-22",
|
||||
"android-23",
|
||||
"android-24",
|
||||
"android-25" ].forEach(function(target) {
|
||||
expect(list).toContain(target);
|
||||
});
|
||||
expect(list).toContain("android-25");
|
||||
}).fail(function(err) {
|
||||
console.log(err);
|
||||
expect(err).toBeUndefined();
|
||||
@ -82,32 +76,48 @@ describe("android_sdk", function () {
|
||||
});
|
||||
});
|
||||
describe("list_targets", function() {
|
||||
it("should parse Android SDK installed target information with `android` command first", function() {
|
||||
it("should parse Android SDK installed target information with `avdmanager` command first", function() {
|
||||
var deferred = Q.defer();
|
||||
var android_spy = spyOn(android_sdk, "list_targets_with_android").and.returnValue(deferred.promise);
|
||||
var avdmanager_spy = spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
|
||||
android_sdk.list_targets();
|
||||
expect(android_spy).toHaveBeenCalled();
|
||||
expect(avdmanager_spy).toHaveBeenCalled();
|
||||
});
|
||||
it("should parse Android SDK installed target information with `avdmanager` command if list_targets_with_android fails due to `android` command being obsolete", function(done) {
|
||||
it("should parse Android SDK installed target information with `android` command if list_targets_with_avdmanager fails with ENOENT", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(android_sdk, "list_targets_with_android").and.returnValue(deferred.promise);
|
||||
spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
|
||||
deferred.reject({
|
||||
code: 1,
|
||||
stdout: "The android command is no longer available."
|
||||
code: "ENOENT"
|
||||
});
|
||||
var twoferred = Q.defer();
|
||||
twoferred.resolve(["target1"]);
|
||||
var sdkmanager_spy = spyOn(android_sdk, "list_targets_with_sdkmanager").and.returnValue(twoferred.promise);
|
||||
var avdmanager_spy = spyOn(android_sdk, "list_targets_with_android").and.returnValue(twoferred.promise);
|
||||
return android_sdk.list_targets()
|
||||
.then(function(targets) {
|
||||
expect(sdkmanager_spy).toHaveBeenCalled();
|
||||
expect(avdmanager_spy).toHaveBeenCalled();
|
||||
expect(targets[0]).toEqual("target1");
|
||||
done();
|
||||
});
|
||||
});
|
||||
it("should parse Android SDK installed target information with `android` command if list_targets_with_avdmanager fails with not-recognized error (Windows)", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
|
||||
deferred.reject({
|
||||
code: 1,
|
||||
stderr: "'avdmanager' is not recognized as an internal or external commmand,\r\noperable program or batch file.\r\n"
|
||||
});
|
||||
var twoferred = Q.defer();
|
||||
twoferred.resolve(["target1"]);
|
||||
var avdmanager_spy = spyOn(android_sdk, "list_targets_with_android").and.returnValue(twoferred.promise);
|
||||
return android_sdk.list_targets()
|
||||
.then(function(targets) {
|
||||
expect(avdmanager_spy).toHaveBeenCalled();
|
||||
expect(targets[0]).toEqual("target1");
|
||||
done();
|
||||
});
|
||||
});
|
||||
it("should throw an error if no Android targets were found.", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(android_sdk, "list_targets_with_android").and.returnValue(deferred.promise);
|
||||
spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
|
||||
deferred.resolve([]);
|
||||
return android_sdk.list_targets()
|
||||
.then(function(targets) {
|
||||
|
@ -16,8 +16,8 @@
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
var cc = require("cordova-common");
|
||||
var emu = require("../../bin/templates/cordova/lib/emulator");
|
||||
var superspawn = require("cordova-common").superspawn;
|
||||
var Q = require("q");
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
@ -27,8 +27,8 @@ describe("emulator", function () {
|
||||
describe("list_images_using_avdmanager", function() {
|
||||
it("should properly parse details of SDK Tools 25.3.1 `avdmanager` output", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(cc.superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "avdmanager_list_avd.txt"), "utf-8"));
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.3-avdmanager_list_avd.txt"), "utf-8"));
|
||||
return emu.list_images_using_avdmanager()
|
||||
.then(function(list) {
|
||||
expect(list).toBeDefined();
|
||||
@ -44,10 +44,16 @@ describe("emulator", function () {
|
||||
});
|
||||
});
|
||||
describe("list_images_using_android", function() {
|
||||
it("should invoke `android` with the `list avd` command and _not_ the `list avds` command, as the plural form is not supported in some Android SDK Tools versions", function() {
|
||||
var deferred = Q.defer();
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
emu.list_images_using_android();
|
||||
expect(superspawn.spawn).toHaveBeenCalledWith("android", ["list", "avd"]);
|
||||
});
|
||||
it("should properly parse details of SDK Tools pre-25.3.1 `android list avd` output", function(done) {
|
||||
var deferred = Q.defer();
|
||||
spyOn(cc.superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "android_list_avd.txt"), "utf-8"));
|
||||
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
|
||||
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.2-android_list_avd.txt"), "utf-8"));
|
||||
return emu.list_images_using_android()
|
||||
.then(function(list) {
|
||||
expect(list).toBeDefined();
|
||||
@ -70,41 +76,30 @@ describe("emulator", function () {
|
||||
return cmd;
|
||||
});
|
||||
});
|
||||
it("should try to parse AVD information using `android`", function() {
|
||||
it("should try to parse AVD information using `avdmanager` first", function() {
|
||||
spyOn(shelljs, "which").and.callFake(function(cmd) {
|
||||
if (cmd == "android") {
|
||||
if (cmd == "avdmanager") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
var android_spy = spyOn(emu, "list_images_using_android").and.returnValue({catch:function(){}});
|
||||
emu.list_images();
|
||||
expect(android_spy).toHaveBeenCalled();
|
||||
});
|
||||
it("should catch if `android` exits with non-zero code and specific stdout, and delegate to `avdmanager` if it can find it", function() {
|
||||
spyOn(shelljs, "which").and.callFake(function(cmd) {
|
||||
if (cmd == "android") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
var avdmanager_spy = spyOn(emu, "list_images_using_avdmanager");
|
||||
// Fake out the old promise to feign a failed `android` command
|
||||
spyOn(emu, "list_images_using_android").and.returnValue({
|
||||
catch:function(cb) {
|
||||
cb({
|
||||
code: 1,
|
||||
stdout: ["The android command is no longer available.",
|
||||
"For manual SDK and AVD management, please use Android Studio.",
|
||||
"For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager"].join("\n")
|
||||
});
|
||||
}
|
||||
});
|
||||
var avdmanager_spy = spyOn(emu, "list_images_using_avdmanager").and.returnValue({catch:function(){}});
|
||||
emu.list_images();
|
||||
expect(avdmanager_spy).toHaveBeenCalled();
|
||||
});
|
||||
it("should delegate to `android` if `avdmanager` cant be found and `android` can", function() {
|
||||
spyOn(shelljs, "which").and.callFake(function(cmd) {
|
||||
if (cmd == "avdmanager") {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
var android_spy = spyOn(emu, "list_images_using_android");
|
||||
emu.list_images();
|
||||
expect(android_spy).toHaveBeenCalled();
|
||||
});
|
||||
it("should throw an error if neither `avdmanager` nor `android` are able to be found", function(done) {
|
||||
spyOn(shelljs, "which").and.returnValue(false);
|
||||
return emu.list_images()
|
||||
|
Loading…
Reference in New Issue
Block a user