Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
grunt-monty-python
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
bd15d142
authored
2016-05-24 14:05:54 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Provide a function.bind shim, until phantomjs is updated.
1 parent
fb3ecf8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
grunt-monty-python.js
grunt-monty-python.js
View file @
bd15d14
...
...
@@ -423,6 +423,28 @@ module.exports = function (grunt) {
});
var
requireCallback
=
function
requireCallback
(
mpConfigBase
,
withCoverage
)
{
/* global requirejs:false */
Function
.
prototype
.
bind
=
function
bind
()
{
if
(
typeof
this
!==
'function'
)
{
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw
new
TypeError
(
'Function.prototype.bind - what is trying to be bound is not callable'
);
}
var
aArgs
=
Array
.
prototype
.
slice
.
call
(
arguments
,
1
),
fToBind
=
this
,
fNOP
=
function
()
{},
fBound
=
function
()
{
return
fToBind
.
apply
(
this
,
aArgs
.
concat
(
Array
.
prototype
.
slice
.
call
(
arguments
)));
};
if
(
this
.
prototype
)
{
// Function.prototype doesn't have a prototype property
fNOP
.
prototype
=
this
.
prototype
;
}
fBound
.
prototype
=
new
fNOP
();
return
fBound
;
};
requirejs
.
load
=
(
function
(
oldLoad
)
{
return
function
(
context
,
moduleName
,
url
)
{
//console.log('context=' + JSON.stringify(arguments), 'moduleName=' + moduleName, 'url=' + url);
...
...
Please
register
or
sign in
to post a comment