Locator/JavaScript: Fix min/max with more than 2 arguments

Pass a variable amount of arguments along

Task-number: QTCREATORBUG-20167
Change-Id: I3643aca8c18cba14beb8d625b62f45aa4b39d2a4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Eike Ziller
2018-03-28 14:13:14 +02:00
parent aa2ea72679
commit b8eea8f9f8
2 changed files with 6 additions and 6 deletions

View File

@@ -3112,11 +3112,11 @@
\li log(x) \li log(x)
\li Returns the natural logarithm (base E) of x \li Returns the natural logarithm (base E) of x
\row \row
\li max(x, y) \li max([value1[, value2[, ...]]])
\li Returns the higher value of x and y \li Returns the highest value of the given numbers
\row \row
\li min(x, y) \li min([value1[, value2[, ...]]])
\li Returns the lower value of x and y \li Returns the lowest value of the given numbers
\row \row
\li oct(x) \li oct(x)
\li Returns the octal representation of x \li Returns the octal representation of x

View File

@@ -133,8 +133,8 @@ void JavaScriptFilter::setupEngine()
"function floor(x) { return Math.floor(x); }\n" "function floor(x) { return Math.floor(x); }\n"
"function hex(x) { return '0x' + x.toString(16); }\n" "function hex(x) { return '0x' + x.toString(16); }\n"
"function log(x) { return Math.log(x); }\n" "function log(x) { return Math.log(x); }\n"
"function max(x, y) { return Math.max(x, y); }\n" "function max() { return Math.max.apply(null, arguments); }\n"
"function min(x, y) { return Math.min(x, y); }\n" "function min() { return Math.min.apply(null, arguments); }\n"
"function oct(x) { return '0' + x.toString(8); }\n" "function oct(x) { return '0' + x.toString(8); }\n"
"function pi() { return Math.PI; }\n" "function pi() { return Math.PI; }\n"
"function pow(x, y) { return Math.pow(x, y); }\n" "function pow(x, y) { return Math.pow(x, y); }\n"