Browse Source

Reorder parameters

Steven Silvester 8 years ago
parent
commit
b779e37bc1

+ 1 - 1
packages/cells/src/widget.ts

@@ -633,7 +633,7 @@ namespace CodeCell {
     cell.setPrompt('*');
     model.trusted = true;
 
-    return OutputArea.execute(cell.outputArea, code, session).then(msg => {
+    return OutputArea.execute(code, cell.outputArea, session).then(msg => {
       model.executionCount = msg.content.execution_count;
       return msg;
     });

+ 1 - 1
packages/outputarea/src/widget.ts

@@ -428,7 +428,7 @@ namespace OutputArea {
    * Execute code on an output area.
    */
   export
-  function execute(output: OutputArea, code: string, session: IClientSession): Promise<KernelMessage.IExecuteReplyMsg> {
+  function execute(code: string, output: OutputArea, session: IClientSession): Promise<KernelMessage.IExecuteReplyMsg> {
     // Override the default for `stop_on_error`.
     let content: KernelMessage.IExecuteRequest = {
       code,

+ 2 - 2
test/src/outputarea/widget.spec.ts

@@ -213,7 +213,7 @@ describe('outputarea/widget', () => {
 
       it('should execute code on a kernel and send outputs to the model', () => {
         return session.kernel.ready.then(() => {
-          return OutputArea.execute(widget, CODE, session).then(reply => {
+          return OutputArea.execute(CODE, widget, session).then(reply => {
             expect(reply.content.execution_count).to.be.ok();
             expect(reply.content.status).to.be('ok');
             expect(model.length).to.be(1);
@@ -223,7 +223,7 @@ describe('outputarea/widget', () => {
 
       it('should clear existing outputs', () => {
         widget.model.fromJSON(DEFAULT_OUTPUTS);
-        return OutputArea.execute(widget, CODE, session).then(reply => {
+        return OutputArea.execute(CODE, widget, session).then(reply => {
           expect(reply.content.execution_count).to.be.ok();
           expect(model.length).to.be(1);
         });