diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-01-20 15:59:25 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-01-20 15:59:25 +0100 |
| commit | 86b15b7e9d850829aff1f1e6a07e0c96299e492b (patch) | |
| tree | d5683322d66f386c59074414ee11f919b1c578ff /addons/web/static/lib/underscore/underscore.string.js | |
| parent | 7b38be73702ad7bf41a7332b64d07ae9aa047672 (diff) | |
[FIX] error reporting in _.sprintf
bzr revid: xmo@openerp.com-20120120145925-jko6qqombu3fxpoj
Diffstat (limited to 'addons/web/static/lib/underscore/underscore.string.js')
| -rw-r--r-- | addons/web/static/lib/underscore/underscore.string.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/web/static/lib/underscore/underscore.string.js b/addons/web/static/lib/underscore/underscore.string.js index 99966c3f475..d0b6ff1ffb3 100644 --- a/addons/web/static/lib/underscore/underscore.string.js +++ b/addons/web/static/lib/underscore/underscore.string.js @@ -73,7 +73,7 @@ arg = argv[cursor]; for (k = 0; k < match[2].length; k++) { if (!arg.hasOwnProperty(match[2][k])) { - throw(sprintf('[_.sprintf] property "%s" does not exist', match[2][k])); + throw new Error(sprintf('[_.sprintf] property "%s" does not exist', match[2][k])); } arg = arg[match[2][k]]; } @@ -85,7 +85,7 @@ } if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) { - throw(sprintf('[_.sprintf] expecting number but found %s', get_type(arg))); + throw new Error(sprintf('[_.sprintf] expecting number but found %s', get_type(arg))); } switch (match[8]) { case 'b': arg = arg.toString(2); break; @@ -134,12 +134,12 @@ field_list.push(field_match[1]); } else { - throw('[_.sprintf] huh?'); + throw new Error('[_.sprintf] huh?'); } } } else { - throw('[_.sprintf] huh?'); + throw new Error('[_.sprintf] huh?'); } match[2] = field_list; } @@ -147,12 +147,12 @@ arg_names |= 2; } if (arg_names === 3) { - throw('[_.sprintf] mixing positional and named placeholders is not (yet) supported'); + throw new Error('[_.sprintf] mixing positional and named placeholders is not (yet) supported'); } parse_tree.push(match); } else { - throw('[_.sprintf] huh?'); + throw new Error('[_.sprintf] huh?'); } _fmt = _fmt.substring(match[0].length); } |
