Skip to content
This repository
Browse code

Added fix for Opera stacktrace in message output

  • Loading branch information...
commit edd1b1a3d2a26ec1a4294e746445f93548242822 1 parent c6f94b8
alechill authored
7 src/livevalidation_prototype.js
... ... @@ -1,5 +1,5 @@
1 1 // LiveValidation 1.4 (prototype.js version)
2   -// Copyright (c) 2007-2008 Alec Hill (www.livevalidation.com)
  2 +// Copyright (c) 2007-2010 Alec Hill (www.livevalidation.com)
3 3 // LiveValidation is licensed under the terms of the MIT License
4 4
5 5 var LiveValidation = Class.create();
@@ -301,8 +301,9 @@ LiveValidation.prototype = {
301 301 } catch(error) {
302 302 if(error instanceof Validate.Error){
303 303 if( value !== '' || (value === '' && this.displayMessageWhenEmpty) ){
304   - this.validationFailed = true;
305   - this.message = error.message;
  304 + this.validationFailed = true;
  305 + // Opera 10 adds stacktrace after newline
  306 + this.message = error.message.split('\n')[0];
306 307 isValid = false;
307 308 }
308 309 }else{
5 src/livevalidation_standalone.js
... ... @@ -1,5 +1,5 @@
1 1 // LiveValidation 1.4 (standalone version)
2   -// Copyright (c) 2007-2008 Alec Hill (www.livevalidation.com)
  2 +// Copyright (c) 2007-2010 Alec Hill (www.livevalidation.com)
3 3 // LiveValidation is licensed under the terms of the MIT License
4 4
5 5 /*********************************************** LiveValidation class ***********************************/
@@ -305,7 +305,8 @@ LiveValidation.prototype = {
305 305 if(error instanceof Validate.Error){
306 306 if( value !== '' || (value === '' && this.displayMessageWhenEmpty) ){
307 307 this.validationFailed = true;
308   - this.message = error.message;
  308 + // Opera 10 adds stacktrace after newline
  309 + this.message = error.message.split('\n')[0];
309 310 isValid = false;
310 311 }
311 312 }else{

0 comments on commit edd1b1a

Please sign in to comment.
Something went wrong with that request. Please try again.