This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _createJLayoutWrapper = function (handlePosition, predicate, getSize) { | |
var wrapper = { | |
bounds : function (value) { | |
if (value) { | |
handlePosition(value); | |
} | |
return getSize(); | |
}, | |
isVisible : predicate, | |
insets : function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var complexHandlePosition = function (a, b, c, d, bounds) { | |
... | |
}; | |
//a, b are available in aVal, bVal | |
var easierHandlePosition = _.partial( | |
complexHandlePosition, | |
aVal, | |
bVal | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var complexPredicate = function (a, b, c) { | |
... | |
}; | |
//a, b, c are available in aVal, bVal, cVal | |
var precalculatedPredicate = _constant( | |
complexPredicate( | |
aVal, | |
bVal, | |
cVal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myJLayoutWrapper = _createJLayoutWrapper( | |
trivialHandlePosition, | |
precalcuatedPredicate, | |
_.noop //not interessted in putting in a valid size | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var books = [ | |
{ | |
name: "Little Miss Sunshine", | |
numberOfPages: 32 | |
}, | |
{ | |
name: "Mr. Strong", | |
numberOfPages: 36 | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.mixin( | |
{ | |
"preserveCallersFirstNParams" : function (func, n) { | |
n = n || 0; | |
return function () { | |
return func.apply(this, Array.prototype.slice.call(arguments, 0, n)); | |
}; | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var setTimeout, | |
clearTimeout, | |
setInterval, | |
clearInterval, | |
endAllTimers; | |
(function () { | |
var timer = new java.util.Timer(); | |
var counter = 1; | |
var ids = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TextReporter.prototype = new jasmine.Reporter(); | |
TextReporter.prototype.onRunnerFinished = function (callback) { | |
this.callbackEnd = callback; | |
}; | |
TextReporter.prototype.reportRunnerResults = function (runner) { | |
// When all the spec are finished // | |
var result = runner.results(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Imported by Rhino on command shell | |
/*global load, print*/ | |
load("lib/Timer.js"); | |
/*global endAllTimers*/ | |
load("lib/TextReporter.js"); | |
/*global TextReporter*/ | |
load("lib/jasmine-1.3.0/jasmine.js"); | |
/*global jasmine*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//expected call for book[0]: | |
_.result(books[0], "numberOfPages"); | |
//evaluated call: | |
_.result(books[0], 0, books, "numberOfPages"); | |
//which means effectivly | |
_.result(books[0], 0); |
OlderNewer