changeset 3e66fd9e064f in sao:default
details: https://hg.tryton.org/sao?cmd=changeset&node=3e66fd9e064f
description:
Use default function parameters
issue8183
review386321002
diffstat:
src/action.js | 11 +------
src/common.js | 42 +++++----------------------
src/model.js | 84 +++++++++++++------------------------------------------
src/pyson.js | 62 ++++++++++-------------------------------
src/rpc.js | 5 +--
src/sao.js | 23 ++------------
src/screen.js | 47 +++++++++++--------------------
src/session.js | 5 +--
src/tab.js | 5 +--
src/view/form.js | 21 ++++---------
src/view/tree.js | 12 ++------
src/window.js | 9 +----
12 files changed, 81 insertions(+), 245 deletions(-)
diffs (803 lines):
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/action.js
--- a/src/action.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/action.js Sun Apr 10 19:25:17 2022 +0200
@@ -145,15 +145,8 @@
}
};
- Sao.Action.exec_keyword = function(keyword, data, context, warning,
- alwaysask)
- {
- if (warning === undefined) {
- warning = true;
- }
- if (alwaysask === undefined) {
- alwaysask = false;
- }
+ Sao.Action.exec_keyword = function(
+ keyword, data, context, warning=true, alwaysask=false) {
var actions = [];
var model_id = data.id;
var args = {
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/common.js
--- a/src/common.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/common.js Sun Apr 10 19:25:17 2022 +0200
@@ -121,10 +121,7 @@
return result;
};
- Sao.common.selection = function(title, values, alwaysask) {
- if (alwaysask === undefined) {
- alwaysask = false;
- }
+ Sao.common.selection = function(title, values, alwaysask=false) {
var prm = jQuery.Deferred();
if (jQuery.isEmptyObject(values)) {
prm.reject();
@@ -625,9 +622,7 @@
}
};
- Sao.common.EvalEnvironment = function(parent_, eval_type) {
- if (eval_type === undefined)
- eval_type = 'eval';
+ Sao.common.EvalEnvironment = function(parent_, eval_type='eval') {
var environment;
if (eval_type == 'eval') {
environment = parent_.get_eval();
@@ -947,10 +942,7 @@
this.stream = stream.split('');
this.i = 0;
},
- read: function(length) {
- if (length === undefined) {
- length = 1;
- }
+ read: function(length=1) {
if (this.i >= this.stream.length) {
return null;
}
@@ -1435,10 +1427,7 @@
is_leaf: function(element) {
return ((element instanceof Array) && element.clause);
},
- ending_clause: function(domain, depth) {
- if (depth === undefined) {
- depth = 0;
- }
+ ending_clause: function(domain, depth=0) {
if (domain.length === 0) {
return [null, depth];
}
@@ -2075,13 +2064,7 @@
return value;
}
},
- format_value: function(field, value, target, context) {
- if (target === undefined) {
- target = null;
- }
- if (!context) {
- context = {};
- }
+ format_value: function(field, value, target=null, context={}) {
var format_float = function() {
if (!value && value !== 0 && value !== new Sao.Decimal(0)) {
return '';
@@ -2266,10 +2249,7 @@
'child_of': function() {return true;},
'not child_of': function() {return true;}
},
- locale_part: function(expression, field_name, locale_name) {
- if (locale_name === undefined) {
- locale_name = 'id';
- }
+ locale_part: function(expression, field_name, locale_name='id') {
if (expression === field_name) {
return locale_name;
}
@@ -2716,10 +2696,7 @@
return new And(domain.slice(begin));
}
},
- domain_inversion: function(domain, symbol, context) {
- if (context === undefined) {
- context = {};
- }
+ domain_inversion: function(domain, symbol, context={}) {
var expression = this.parse(domain);
if (!~expression.variables.indexOf(symbol)) {
return true;
@@ -4084,10 +4061,7 @@
else if (i == 5) return [v, p, q];
};
- Sao.common.generateColorscheme = function(masterColor, keys, light) {
- if (light === undefined) {
- light = 0.1;
- }
+ Sao.common.generateColorscheme = function(masterColor, keys, light=0.1) {
var rgb = Sao.common.hex2rgb(
Sao.common.COLOR_SCHEMES[masterColor] || masterColor);
var hsv = Sao.common.rgb2hsv(rgb);
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/model.js
--- a/src/model.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/model.js Sun Apr 10 19:25:17 2022 +0200
@@ -24,10 +24,7 @@
}
return added;
},
- execute: function(method, params, context, async) {
- if (context === undefined) {
- context = {};
- }
+ execute: function(method, params, context={}, async=true) {
var args = {
'method': 'model.' + this.name + '.' + method,
'params': params.concat(context)
@@ -79,8 +76,8 @@
this.__readonly = value;
}
});
- array.load = function(ids, modified, position) {
- if ((position === undefined) || (position == -1)) {
+ array.load = function(ids, modified=false, position=-1) {
+ if (position == -1) {
position = this.length;
}
var new_records = [];
@@ -138,14 +135,11 @@
}
return record;
};
- array.add = function(record, position, changed) {
- if ((position === undefined) || (position == -1)) {
+ array.add = function(record, position=-1, changed=true) {
+ if (position == -1) {
position = this.length;
}
position = Math.min(position, this.length);
- if (changed === undefined) {
- changed = true;
- }
if (record.group != this) {
record.group = this;
}
@@ -181,13 +175,8 @@
}
return record;
};
- array.remove = function(record, remove, modified, force_remove,
signal) {
- if (modified === undefined) {
- modified = true;
- }
- if (signal === undefined) {
- signal = true;
- }
+ array.remove = function(
+ record, remove, modified=true, force_remove=false, signal=true) {
var idx = this.indexOf(record);
if (record.id >= 0) {
if (remove) {
@@ -546,10 +535,10 @@
Sao.Record = Sao.class_(Object, {
id_counter: -1,
- init: function(model, id) {
+ init: function(model, id=null) {
this.model = model;
this.group = Sao.Group(model, {}, []);
- if ((id === undefined) || (id === null)) {
+ if (id === null) {
this.id = Sao.Record.prototype.id_counter;
} else {
this.id = id;
@@ -582,10 +571,7 @@
return false;
}
},
- save: function(force_reload) {
- if (force_reload === undefined) {
- force_reload = false;
- }
+ save: function(force_reload=false) {
var context = this.get_context();
var prm = jQuery.when();
if ((this.id < 0) || this.modified) {
@@ -647,12 +633,9 @@
is_loaded: function(name) {
return ((this.id < 0) || (name in this._loaded));
},
- load: function(name, async) {
+ load: function(name, async=true) {
var fname;
var prm;
- if (async === undefined) {
- async = true;
- }
if (this.destroyed || this.is_loaded(name)) {
if (async) {
return jQuery.when();
@@ -790,8 +773,7 @@
var result = this.model.execute('read',
[Object.keys(id2record).map(
function (e) { return parseInt(e, 10); }),
fnames_to_fetch], context, async);
- var succeed = function(values, exception) {
- if (exception === undefined) exception = false;
+ var succeed = function(values, exception=false) {
var id2value = {};
values.forEach(function(e, i, a) {
id2value[e.id] = e;
@@ -846,10 +828,7 @@
}
}
},
- set: function(values, validate) {
- if (validate === undefined) {
- validate = true;
- }
+ set: function(values, validate=true) {
var name, value;
var rec_named_fields = ['many2one', 'one2one', 'reference'];
var later = {};
@@ -979,13 +958,7 @@
}
return jQuery.when();
},
- set_default: function(values, validate, display) {
- if (validate === undefined) {
- validate = true;
- }
- if (display === undefined) {
- display = true;
- }
+ set_default: function(values, validate=true, display=true) {
var promises = [];
var fieldnames = [];
for (var fname in values) {
@@ -1644,10 +1617,8 @@
get_on_change_value: function(record) {
return this.get_eval(record);
},
- set_state: function(record, states) {
- if (states === undefined) {
- states = ['readonly', 'required', 'invisible'];
- }
+ set_state: function(
+ record, states=['readonly', 'required', 'invisible']) {
var state_changes = record.expr_eval(
this.description.states || {});
states.forEach(function(state) {
@@ -1887,10 +1858,7 @@
Sao.field.Float = Sao.class_(Sao.field.Field, {
_default: null,
- digits: function(record, factor) {
- if (factor === undefined) {
- factor = 1;
- }
+ digits: function(record, factor=1) {
var digits = record.expr_eval(this.description.digits);
if (typeof(digits) == 'string') {
if (!(digits in record.model.fields)) {
@@ -1983,21 +1951,12 @@
}
return value;
},
- set_client: function(record, value, force_change, factor) {
- if (factor === undefined) {
- factor = 1;
- }
+ set_client: function(record, value, force_change, factor=1) {
value = this.apply_factor(record, this.convert(value), factor);
Sao.field.Float._super.set_client.call(this, record, value,
force_change);
},
- get_client: function(record, factor, grouping) {
- if (factor === undefined) {
- factor = 1;
- }
- if (grouping === undefined) {
- grouping = true;
- }
+ get_client: function(record, factor=1, grouping=true) {
var value = this.get(record);
if (value !== null) {
var options = {
@@ -2218,10 +2177,7 @@
});
}
},
- set: function(record, value, _default) {
- if (_default === undefined) {
- _default = false;
- }
+ set: function(record, value, _default=false) {
var group = record._values[this.name];
var model;
if (group !== undefined) {
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/pyson.js
--- a/src/pyson.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/pyson.js Sun Apr 10 19:25:17 2022 +0200
@@ -32,10 +32,7 @@
types: function() {
throw 'NotImplementedError';
},
- get: function(k, d) {
- if (d === undefined) {
- d = '';
- }
+ get: function(k, d='') {
return Sao.PYSON.Get(this, k, d);
},
in_: function(obj) {
@@ -144,10 +141,7 @@
return new Sao.PYSON.Eval(value, default_);
};
Sao.PYSON.Eval = Sao.class_(Sao.PYSON.PYSON, {
- init: function(value, default_) {
- if (default_ === undefined) {
- default_ = '';
- }
+ init: function(value, default_='') {
Sao.PYSON.Eval._super.init.call(this);
this._value = value;
this._default = default_;
@@ -409,7 +403,7 @@
return new Sao.PYSON.Greater(statement1, statement2, equal);
};
Sao.PYSON.Greater = Sao.class_(Sao.PYSON.PYSON, {
- init: function(statement1, statement2, equal) {
+ init: function(statement1, statement2, equal=false) {
Sao.PYSON.Greater._super.init.call(this);
var statements = [statement1, statement2];
for (var i = 0; i < 2; i++) {
@@ -428,9 +422,6 @@
}
}
}
- if (equal === undefined) {
- equal = false;
- }
if (equal instanceof Sao.PYSON.PYSON) {
if (jQuery(equal.types()).not(['boolean']).length ||
jQuery(['boolean']).not(equal.types()).length) {
@@ -522,7 +513,7 @@
return new Sao.PYSON.If(condition, then_statement, else_statement);
};
Sao.PYSON.If = Sao.class_(Sao.PYSON.PYSON, {
- init: function(condition, then_statement, else_statement) {
+ init: function(condition, then_statement, else_statement=null) {
Sao.PYSON.If._super.init.call(this);
if (condition instanceof Sao.PYSON.PYSON) {
if (jQuery(condition.types()).not(['boolean']).length ||
@@ -538,9 +529,6 @@
} else {
then_types = [typeof then_statement];
}
- if (else_statement === undefined) {
- else_statement = null;
- }
if (else_statement instanceof Sao.PYSON.PYSON) {
else_types = else_statement.types();
} else {
@@ -590,11 +578,8 @@
return new Sao.PYSON.Get(obj, key, default_);
};
Sao.PYSON.Get = Sao.class_(Sao.PYSON.PYSON, {
- init: function(obj, key, default_) {
+ init: function(obj, key, default_=null) {
Sao.PYSON.Get._super.init.call(this);
- if (default_ === undefined) {
- default_ = null;
- }
if (obj instanceof Sao.PYSON.PYSON) {
if (jQuery(obj.types()).not(['object']).length ||
jQuery(['object']).not(obj.types()).length) {
@@ -714,16 +699,9 @@
};
Sao.PYSON.Date = Sao.class_(Sao.PYSON.PYSON, {
init: function(
- year, month, day, delta_years, delta_months, delta_days, start)
- {
+ year=null, month=null, day=null,
+ delta_years=0, delta_months=0, delta_days=0, start=null) {
Sao.PYSON.Date._super.init.call(this);
- if (year === undefined) year = null;
- if (month === undefined) month = null;
- if (day === undefined) day = null;
- if (delta_years === undefined) delta_years = 0;
- if (delta_months === undefined) delta_months = 0;
- if (delta_days === undefined) delta_days = 0;
-
this._test(year, 'year');
this._test(month, 'month');
this._test(day, 'day');
@@ -737,7 +715,7 @@
this._delta_years = delta_years;
this._delta_months = delta_months;
this._delta_days = delta_days;
- this._start = start || null;
+ this._start = start;
},
pyson: function() {
return {
@@ -801,20 +779,14 @@
delta_minutes, delta_seconds, delta_microseconds);
};
Sao.PYSON.DateTime = Sao.class_(Sao.PYSON.Date, {
- init: function(year, month, day, hour, minute, second, microsecond,
- delta_years, delta_months, delta_days, delta_hours,
- delta_minutes, delta_seconds, delta_microseconds, start) {
+ init: function(
+ year=null, month=null, day=null,
+ hour=null, minute=null, second=null, microsecond=null,
+ delta_years=0, delta_months=0, delta_days=0,
+ delta_hours=0, delta_minutes=0, delta_seconds=0,
+ delta_microseconds=0, start=null) {
Sao.PYSON.DateTime._super.init.call(this, year, month, day,
delta_years, delta_months, delta_days, start);
- if (hour === undefined) hour = null;
- if (minute === undefined) minute = null;
- if (second === undefined) second = null;
- if (microsecond === undefined) microsecond = null;
- if (delta_hours === undefined) delta_hours = 0;
- if (delta_minutes === undefined) delta_minutes = 0;
- if (delta_seconds === undefined) delta_seconds = 0;
- if (delta_microseconds === undefined) delta_microseconds = 0;
-
this._test(hour, 'hour');
this._test(minute, 'minute');
this._test(second, 'second');
@@ -891,12 +863,8 @@
return new Sao.PYSON.TimeDelta(days, seconds, microseconds);
};
Sao.PYSON.TimeDelta = Sao.class_(Sao.PYSON.PYSON, {
- init: function(days, seconds, microseconds) {
+ init: function(days=0, seconds=0, microseconds=0) {
Sao.PYSON.TimeDelta._super.init.call(this);
- if (days === undefined) days = 0;
- if (seconds === undefined) seconds = 0;
- if (microseconds === undefined) microseconds = 0;
-
function test(value, name) {
if (value instanceof Sao.PYSON.TimeDelta) {
if (jQuery(value.types()).not(['number']).length)
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/rpc.js
--- a/src/rpc.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/rpc.js Sun Apr 10 19:25:17 2022 +0200
@@ -3,15 +3,12 @@
(function() {
'use strict';
- Sao.rpc = function(args, session, async) {
+ Sao.rpc = function(args, session=null, async=true) {
var dfd = jQuery.Deferred(),
result;
if (!session) {
session = new Sao.Session();
}
- if (async === undefined) {
- async = true;
- }
var params = jQuery.extend([], args.params);
params.push(jQuery.extend({}, session.context, params.pop()));
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/sao.js
--- a/src/sao.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/sao.js Sun Apr 10 19:25:17 2022 +0200
@@ -264,26 +264,15 @@
Sao.Date.max.set({hour: 0, minute: 0, second: 0, millisecond: 0});
Sao.Date.max.isDate = true;
- Sao.DateTime = function(year, month, day, hour, minute, second,
- millisecond, utc) {
+ Sao.DateTime = function(
+ year, month, day,
+ hour=0, minute=0, second=0, millisecond=0, utc=false) {
var datetime;
if (month === undefined) {
datetime = moment(year);
year = undefined;
}
else {
- if (hour === undefined) {
- hour = 0;
- }
- if (minute === undefined) {
- minute = 0;
- }
- if (second === undefined) {
- second = 0;
- }
- if (millisecond === undefined) {
- millisecond = 0;
- }
datetime = moment();
}
if (utc) {
@@ -890,11 +879,7 @@
});
Sao.Dialog = Sao.class_(Object, {
- init: function(title, class_, size, keyboard) {
- size = size || 'sm';
- if (keyboard === undefined) {
- keyboard = true;
- }
+ init: function(title, class_, size='sm', keyboard=true) {
this.modal = jQuery('<div/>', {
'class': class_ + ' modal fade',
'role': 'dialog',
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/screen.js
--- a/src/screen.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/screen.js Sun Apr 10 19:25:17 2022 +0200
@@ -360,11 +360,11 @@
}
return this.tab_domain[idx][1];
},
- set_tab_counter: function(count, idx) {
+ set_tab_counter: function(count, idx=null) {
if (jQuery.isEmptyObject(this.tab_counter) || !this.tab) {
return;
}
- if ((idx === undefined) || (idx === null)) {
+ if (idx === null) {
idx = this.tab.find('li').index(this.tab.find('li.active'));
}
if (idx < 0) {
@@ -943,12 +943,10 @@
get number_of_views() {
return this.views.length + this.view_to_load.length;
},
- switch_view: function(view_type, view_id, creatable, display) {
- display = display === undefined ? true : display;
- if ((view_id !== undefined) && (view_id !== null)) {
+ switch_view: function(
+ view_type=null, view_id=null, creatable=null, display=true) {
+ if (view_id !== null) {
view_id = Number(view_id);
- } else {
- view_id = null;
}
if (this.current_view) {
this.current_view.set_value();
@@ -972,13 +970,13 @@
return false;
}
var result = true;
- if ((view_type !== undefined) && (view_type !== null)) {
+ if (view_type !== null) {
result &= this.current_view.view_type == view_type;
}
- if ((view_id !== undefined) && (view_id !== null)) {
+ if (view_id !== null) {
result &= this.current_view.view_id == view_id;
}
- if ((creatable !== undefined) && (creatable !== null)) {
+ if (creatable !== null) {
result &= this.current_view.creatable == creatable;
}
return result;
@@ -1110,15 +1108,14 @@
}.bind(this));
}.bind(this));
},
- search_domain: function(search_string, set_text, with_tab) {
+ search_domain: function(search_string=null, set_text=false,
with_tab=true) {
set_text = set_text || false;
- with_tab = with_tab === undefined ? true : with_tab;
var domain = [];
// Test first parent to avoid calling unnecessary domain_parser
if (!this.group.parent && this.domain_parser) {
var domain_parser = this.domain_parser;
- if (search_string || search_string === '') {
+ if (search_string !== null) {
domain = domain_parser.parse(search_string);
} else {
domain = this.attributes.search_value;
@@ -1169,10 +1166,7 @@
}
return domain;
},
- count_tab_domain: function(current) {
- if (current === undefined) {
- current = false;
- }
+ count_tab_domain: function(current=false) {
var screen_domain = this.search_domain(
this.screen_container.get_text(), false, false);
var index = this.screen_container.get_tab_index();
@@ -1255,13 +1249,13 @@
group.readonly = this.attributes.readonly;
this.set_group(group);
},
- record_modified: function(display) {
+ record_modified: function(display=true) {
this.windows.forEach(function(window_) {
if (window_.record_modified) {
window_.record_modified();
}
});
- if (display || display === undefined) {
+ if (display) {
return this.display();
}
},
@@ -1322,11 +1316,8 @@
}
}
},
- load: function(ids, set_cursor, modified) {
- if (set_cursor === undefined) {
- set_cursor = true;
- }
- this.group.load(ids, modified);
+ load: function(ids, set_cursor=true, modified=false, position=-1) {
+ this.group.load(ids, modified, position);
this.current_view.reset();
if (ids.length && this.current_view.view_type != 'calendar') {
this.current_record = this.group.get(ids[0]);
@@ -1483,11 +1474,8 @@
return this.current_record.id;
}
},
- new_: function(default_, rec_name) {
+ new_: function(default_=true, rec_name=null) {
var previous_view = this.current_view;
- if (default_ === undefined) {
- default_ = true;
- }
var prm = jQuery.when();
if (this.current_view.view_type == 'calendar') {
var selected_date = this.current_view.get_selected_date();
@@ -2131,10 +2119,9 @@
}
return path;
},
- save_tree_state: function(store) {
+ save_tree_state: function(store=true) {
var prms = [];
var prm;
- store = (store === undefined) ? true : store;
var i, len, view, widgets, wi, wlen;
var parent_ = this.group.parent ? this.group.parent.id : null;
var clear_cache = function() {
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/session.js
--- a/src/session.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/session.js Sun Apr 10 19:25:17 2022 +0200
@@ -324,10 +324,7 @@
this.func = func;
this.session = session || Sao.Session.current_session;
},
- run: function(parameters) {
- if (parameters === undefined) {
- parameters = {};
- }
+ run: function(parameters={}) {
var dfd = jQuery.Deferred();
var timeoutID = Sao.common.processing.show();
var data = this.func(parameters);
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/tab.js
--- a/src/tab.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/tab.js Sun Apr 10 19:25:17 2022 +0200
@@ -849,10 +849,7 @@
return this.screen.switch_view();
}.bind(this));
},
- reload: function(test_modified) {
- if (test_modified === undefined) {
- test_modified = true;
- }
+ reload: function(test_modified=true) {
var reload = function() {
return this.screen.cancel_current().then(function() {
var set_cursor = false;
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/view/form.js
--- a/src/view/form.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/view/form.js Sun Apr 10 19:25:17 2022 +0200
@@ -492,8 +492,7 @@
});
Sao.View.Form.Container = Sao.class_(Object, {
- init: function(col) {
- if (col === undefined) col = 4;
+ init: function(col=4) {
if (col < 0) col = 0;
this.col = col;
this.el = jQuery('<table/>', {
@@ -849,9 +848,9 @@
}
return page;
},
- set_current_page: function(page_index) {
+ set_current_page: function(page_index=null) {
var selector;
- if (page_index === undefined) {
+ if (page_index === null) {
selector = ':visible:first';
} else {
selector = ':eq(' + page_index + '):visible';
@@ -2602,17 +2601,14 @@
id_from_value: function(value) {
return value;
},
- value_from_id: function(id, str) {
- if (str === undefined) {
- str = '';
- }
+ value_from_id: function(id, str='') {
return [id, str];
},
get_model: function() {
return this.attributes.relation;
},
- has_target: function(value) {
- return value !== undefined && value !== null;
+ has_target: function(value=null) {
+ return value !== null;
},
edit: function(evt) {
var model = this.get_model();
@@ -4724,10 +4720,7 @@
}.bind(this));
}.bind(this));
},
- remove: function(key, modified) {
- if (modified === undefined) {
- modified = true;
- }
+ remove: function(key, modified=true) {
delete this.fields[key];
this.rows[key].remove();
delete this.rows[key];
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/view/tree.js
--- a/src/view/tree.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/view/tree.js Sun Apr 10 19:25:17 2022 +0200
@@ -339,8 +339,7 @@
.append(' ' + optional.attributes.string))));
});
},
- save_optional: function(store) {
- store = (store === undefined) ? true : store;
+ save_optional: function(store=true) {
var fields = {};
this.optionals.forEach(function(column) {
fields[column.attributes.name] = !column.get_visible();
@@ -1224,14 +1223,9 @@
get_selected(this, []);
return selected_paths;
},
- get_expanded_paths: function(starting_path, starting_id_path) {
+ get_expanded_paths: function(
+ starting_path=[], starting_id_path=[]) {
var id_path, id_paths, row, children_rows, path;
- if (starting_path === undefined) {
- starting_path = [];
- }
- if (starting_id_path === undefined) {
- starting_id_path = [];
- }
id_paths = [];
row = this.find_row(starting_path);
children_rows = row ? row.rows : this.rows;
diff -r 9fcd7c12adfa -r 3e66fd9e064f src/window.js
--- a/src/window.js Wed Apr 06 18:46:47 2022 +0200
+++ b/src/window.js Sun Apr 10 19:25:17 2022 +0200
@@ -2090,13 +2090,8 @@
},
});
- Sao.Window.Export.format_row = function(line, indent, locale_format) {
- if (indent === undefined) {
- indent = 0;
- }
- if (locale_format === undefined) {
- locale_format = true;
- }
+ Sao.Window.Export.format_row = function(
+ line, indent=0, locale_format=true) {
var row = [];
line.forEach(function(val, i) {
if (locale_format) {