File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ // https://github.com/ariya/phantomjs/issues/10522
2
+
3
+ // jshint ignore: start
4
+
5
+ if ( ! Function . prototype . bind ) {
6
+ Function . prototype . bind = function ( oThis ) {
7
+ if ( typeof this !== "function" ) {
8
+ // closest thing possible to the ECMAScript 5 internal IsCallable function
9
+ throw new TypeError ( "Function.prototype.bind - what is trying to be bound is not callable" ) ;
10
+ }
11
+
12
+ var aArgs = Array . prototype . slice . call ( arguments , 1 ) ,
13
+ fToBind = this ,
14
+ fNOP = function ( ) { } ,
15
+ fBound = function ( ) {
16
+ return fToBind . apply ( this instanceof fNOP && oThis
17
+ ? this
18
+ : oThis ,
19
+ aArgs . concat ( Array . prototype . slice . call ( arguments ) ) ) ;
20
+ } ;
21
+
22
+ fNOP . prototype = this . prototype ;
23
+ fBound . prototype = new fNOP ( ) ;
24
+
25
+ return fBound ;
26
+ } ;
27
+ }
Original file line number Diff line number Diff line change 4
4
< meta charset ="utf-8 ">
5
5
< title > Lazy Load XT Test Suite</ title >
6
6
<!-- Load local jQuery. This can be overridden with a ?jquery=___ param. -->
7
+ < script src ="function_bind.js "> </ script >
7
8
< script src ="../libs/domtastic/domtastic.js "> </ script >
8
9
<!-- Load local QUnit. -->
9
10
< link rel ="stylesheet " href ="../libs/qunit/qunit.css " media ="screen ">
Original file line number Diff line number Diff line change 40
40
setTimeout ( function ( ) {
41
41
var $img = $ ( 'img' ) ,
42
42
cntinit = $img . filter ( function ( index , el ) {
43
+ el = el || this ;
43
44
return $ ( el ) . data ( 'lazied' ) ;
44
45
} ) . length ,
45
46
cntnow = $img . filter ( function ( index , el ) {
47
+ el = el || this ;
46
48
return $ ( el ) . data ( 'lazied' ) && ( $ ( el ) . attr ( 'src' ) === $ ( el ) . attr ( 'data-src' ) ) ;
47
49
} ) . length ;
48
50
ok ( $img . length > 0 , 'images should be presented' ) ;
You can’t perform that action at this time.
0 commit comments