Merge branch 'cordova-hcp' of github.com:meteor/meteor into cordova-hcp

This commit is contained in:
Sashko Stubailo
2014-08-11 21:26:39 -07:00
3 changed files with 16 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
// Log all uncaught errors so they can be printed to the developer.
// But since Android's adb catlog already prints the uncaught exceptions, we
// can disable it for Android.
if (! /Android/i.test(navigator.userAgent)) {
window.onerror = function (msg, url, line) {
// Cut off the url prefix, the meaningful part always starts at 'www/' in
// Cordova apps.
url = url.replace(/^.*?\/www\//, '');
console.log('Uncaught Error: ' + msg + ':' + line + ':' + url);
};
}

View File

@@ -15,6 +15,7 @@ Package.on_use(function (api) {
api.export('Log');
api.use(['underscore', 'ejson']);
api.add_files('logging.js');
api.add_files('logging_cordova.js', 'client.cordova');
});
Package.on_test(function (api) {

View File

@@ -405,7 +405,7 @@ var execCordovaOnPlatform = function (localPath, platformName) {
// remove a part of file url we don't like
line = line.replace(/^file:\/\/\/android_asset\/www\//, '');
// filename.js?hashsha1: Line 123 : message goes here
var parsedLine = line.match(/^([^?]+)\?[a-zA-Z0-9]+: Line (\d+) : (.*)$/);
var parsedLine = line.match(/^([^?]+)(\?[a-zA-Z0-9]+)?: Line (\d+) : (.*)$/);
if (! parsedLine)
return Log.format(Log.objFromText(line), { color: true });
@@ -414,8 +414,8 @@ var execCordovaOnPlatform = function (localPath, platformName) {
time: new Date,
level: 'info',
file: parsedLine[1],
line: parsedLine[2],
message: parsedLine[3],
line: parsedLine[3],
message: parsedLine[4],
program: 'android'
};
return Log.format(output, {