Currently, the *launch* function in main.js is the only code that calls `SimulatorProcess.run()`, and it ignores its return value. But a task returns a promise, and it's good practice to explicitly resolve that promise, so it's obvious from reading the task what the return value will be.

Rejecting the promise within a task is simple: just throw an exception anywhere in the task, and Task will reject the promise with the exception's error message. Resolving the promise, on the other hand, depends on how you define the generator function.

If you define it via the non-standard, SpiderMonkey-specific syntax, i.e. a regular function with at least one yield operator inside it (`function() { … yield … }`), then you must resolve the promise by throwing an instance of *Task.Result*, which is a special exception type that Task catches and uses to resolve the promise:

    throw new Task.Result("Value");

If, on the other hand, you use the new, standard "function star" syntax, i.e. `function*() { … }`, then you can resolve the promise simply by returning a value:

    return "Value";

That's a lot easier to read than `throw new Task.Result("Value")`! So I would make this generator function a function*:

```
  run: function () Task.spawn((function*() {
```

And then at the end of the function I would return something, like *this.process*:

```
    // spawn a b2g instance
    this.process = Subprocess.call({
      …
    });

    return this.process;
  }).bind(this)),
```