Lulo/aura — pull request #9 by felixlaumon (2013-11-11 07:16:22+00:00)
Title: [fix] Validate selector in app.sandbox.stop

This prevent Sizzle throwing out error complaining the _ref-like string (e.g. `__component_ad@default-4`) is not a valid selector.

I chose to validate the selector instead of validating the ref because it doesn't necessary have a easily recognized formate. They could be `__component_*` when stopping an individual component or `sandbox-13`, when stopping a sandbox.

I also considered checking for potential child sandboxes before stopping the given one. However, it will result in unnecessary DOM lookup. So I believe the caller of `app.sandbox.stop` that uses direct `ref` should take responsibility for ordering which sandbox should stop first, to prevent leaking sandboxes. (If the parent sandbox is stopped first, the children sandboxes will lose its reference in the sandbox registry (`app.core.appSandbox`)

Finally, this fixes an minor issue that causes the test to fail.

@finalprototype @Buritica @riaguru66 please review