First commit

This commit is contained in:
Theodotos Andreou 2018-01-14 13:10:16 +00:00
commit c6e2478c40
13918 changed files with 2303184 additions and 0 deletions

View file

@ -0,0 +1,14 @@
{
"name": "phantomjs-polyfill",
"homepage": "https://github.com/conversocial/phantomjs-polyfill",
"version": "0.0.2",
"_release": "0.0.2",
"_resolution": {
"type": "version",
"tag": "v0.0.2",
"commit": "a1f767df019a1d02bfca39546dfe6bcc8c057c75"
},
"_source": "https://github.com/conversocial/phantomjs-polyfill.git",
"_target": "^0.0.2",
"_originalSource": "phantomjs-polyfill"
}

View file

@ -0,0 +1,26 @@
# Function.prototype.bind polyfill for PhantomJS
This is a polyfill for function.prototype.bind which is missing from [PhantomJS](http://phantomjs.org/).
## Installation
```
npm install --save-dev phantomjs-polyfill
```
## Usage
```
require('phantomjs-polyfill')
```
### Usage with Karma
Include the polyfill directly in the files list of your karma.conf
```
...
files: [
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
...
]
...

View file

@ -0,0 +1,18 @@
if (typeof Function.prototype.bind != 'function') {
Function.prototype.bind = function bind(obj) {
var args = Array.prototype.slice.call(arguments, 1),
self = this,
nop = function() {
},
bound = function() {
return self.apply(
this instanceof nop ? this : (obj || {}), args.concat(
Array.prototype.slice.call(arguments)
)
);
};
nop.prototype = this.prototype || {};
bound.prototype = new nop();
return bound;
};
}

View file

@ -0,0 +1,24 @@
{
"name": "phantomjs-polyfill",
"version": "0.0.2",
"description": "Polyfill for Function.prototype.bind",
"main": "bind-polyfill.js",
"repository": {
"type": "git",
"url": "git@github.com:tom-james-watson/phantomjs-polyfill.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"phantomjs",
"bind",
"polyfill"
],
"author": "Tom Watson <tom.james.watson@gmail.com>",
"license": "ISC",
"bugs": {
"url": "https://github.com/tom-james-watson/phantomjs-polyfill/issues"
},
"homepage": "https://github.com/tom-james-watson/phantomjs-polyfill"
}