Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 15th, 2012  |  syntax: None  |  size: 0.69 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. I want to return a function and have it evaluated in the calling module
  2. define(function() {
  3.   var stage = {
  4.     before: {
  5.       createCanvas: function() {
  6.         return function() {
  7.           before(function(done) {
  8.             this.canvas = new dropchart.Canvas({
  9.               canvas: argsFor.canvas(),
  10.               data: argsFor.data()
  11.             });
  12.             done();
  13.           });
  14.         };
  15.       }
  16.     }
  17.   };
  18.   return stage;
  19. });
  20.        
  21. define(['jquery', 'dropchart', 'argsFor', 'stage'],
  22.   function($, dropchart, argsFor, stage) {
  23.  
  24.   var should = chai.should();
  25.   var xAxisSpec = {
  26.  
  27.     run: function() {
  28.  
  29.       describe('xAxis', function() {
  30.  
  31.         stage.before.createCanvas();
  32.  
  33.         ...