[gnome-ostree] task: Don't pass the name to the constructor
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-ostree] task: Don't pass the name to the constructor
- Date: Sun, 16 Jun 2013 02:57:47 +0000 (UTC)
commit 46277f422a7bf96c35dea0e9c345d782781ef802
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Jun 13 17:00:45 2013 -0400
task: Don't pass the name to the constructor
We have this on the prototype.
src/js/builtins/run_task.js | 2 +-
src/js/task.js | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/js/builtins/run_task.js b/src/js/builtins/run_task.js
index 552a20d..d3f8b87 100644
--- a/src/js/builtins/run_task.js
+++ b/src/js/builtins/run_task.js
@@ -48,7 +48,7 @@ const RunTask = new Lang.Class({
let taskset = Task.TaskSet.prototype.getInstance();
let taskDef = taskset.getTask(args.taskName);
let params = JSON.parse(args.parameters);
- let instance = new taskDef(args.taskName, params);
+ let instance = new taskDef(params);
instance.execute(cancellable);
}
});
diff --git a/src/js/task.js b/src/js/task.js
index 14c82f3..dba622c 100644
--- a/src/js/task.js
+++ b/src/js/task.js
@@ -122,8 +122,7 @@ const TaskMaster = new Lang.Class({
},
_pushTaskDefImmediate: function(taskDef, parameters) {
- let name = taskDef.prototype.TaskName;
- let instance = new taskDef(name, parameters);
+ let instance = new taskDef(parameters);
this._pendingTasksList.push(instance);
this._queueRecalculate();
},
@@ -300,8 +299,8 @@ const TaskDef = new Lang.Class({
DefaultParameters: {},
- _init: function(name, parameters) {
- this.name = name;
+ _init: function(parameters) {
+ this.name = this.TaskName;
this.parameters = Params.parse(parameters, this.DefaultParameters);
this.workdir = Gio.File.new_for_path(GLib.getenv('_OSTBUILD_WORKDIR'));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]