@@ -57,7 +57,8 @@ it("should be able to use require.js-style define, with empty dependencies", fun
5757} ) ;
5858
5959it ( "should be able to use require.js-style define, with empty dependencies, with a expression" , function ( done ) {
60- define ( [ ] , done ) ;
60+ define ( [ ] , ok ) ;
61+ function ok ( ) { done ( ) } ;
6162} ) ;
6263
6364it ( "should be able to use require.js-style define, with empty dependencies, with a expression and name" , function ( done ) {
@@ -71,7 +72,8 @@ it("should be able to use require.js-style define, without dependencies", functi
7172} ) ;
7273
7374it ( "should be able to use require.js-style define, without dependencies, with a expression" , function ( done ) {
74- true && define ( "name" , done ) ;
75+ true && define ( "name" , ok ) ;
76+ function ok ( ) { done ( ) } ;
7577} ) ;
7678
7779var obj = { } ;
@@ -108,7 +110,8 @@ it("should not crash on require.js require only with array", function() {
108110} ) ;
109111
110112it ( "should be able to use AMD require without function expression (empty array)" , function ( done ) {
111- require ( [ ] , done ) ;
113+ require ( [ ] , ok ) ;
114+ function ok ( ) { done ( ) } ;
112115} ) ;
113116
114117it ( "should be able to use AMD require without function expression" , function ( done ) {
@@ -141,3 +144,35 @@ it("should not fail #138", function(done) {
141144 }
142145 } ( function ( ) { done ( ) } ) ) ;
143146} ) ;
147+
148+ it ( "should parse a bound function expression 1" , function ( done ) {
149+ define ( function ( a , require , exports , module ) {
150+ a . should . be . eql ( 123 ) ;
151+ require . should . be . type ( "function" ) ;
152+ done ( ) ;
153+ } . bind ( null , 123 ) ) ;
154+ } ) ;
155+
156+ it ( "should parse a bound function expression 2" , function ( done ) {
157+ define ( "name" , function ( a , require , exports , module ) {
158+ a . should . be . eql ( 123 ) ;
159+ require . should . be . type ( "function" ) ;
160+ done ( ) ;
161+ } . bind ( null , 123 ) ) ;
162+ } ) ;
163+
164+ it ( "should parse a bound function expression 3" , function ( done ) {
165+ define ( [ "./a" ] , function ( number , a ) {
166+ number . should . be . eql ( 123 ) ;
167+ a . should . be . eql ( "a" ) ;
168+ done ( ) ;
169+ } . bind ( null , 123 ) ) ;
170+ } ) ;
171+
172+ it ( "should parse a bound function expression 4" , function ( done ) {
173+ define ( "name" , [ "./a" ] , function ( number , a ) {
174+ number . should . be . eql ( 123 ) ;
175+ a . should . be . eql ( "a" ) ;
176+ done ( ) ;
177+ } . bind ( null , 123 ) ) ;
178+ } ) ;
0 commit comments