Socket
Socket
Sign inDemoInstall

raf

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raf - npm Package Compare versions

Comparing version 2.0.4 to 3.0.0

.idea/.name

14

index.js

@@ -7,3 +7,2 @@ var now = require('performance-now')

, caf = global['cancel' + suffix] || global['cancelRequest' + suffix]
, isNative = true

@@ -18,4 +17,2 @@ for(var i = 0; i < vendors.length && !raf; i++) {

if(!raf || !caf) {
isNative = false
var last = 0

@@ -69,12 +66,3 @@ , id = 0

// to the native rAF function
if(!isNative) {
return raf.call(global, fn)
}
return raf.call(global, function() {
try{
fn.apply(this, arguments)
} catch(e) {
setTimeout(function() { throw e }, 0)
}
})
return raf.call(global, fn)
}

@@ -81,0 +69,0 @@ module.exports.cancel = function() {

{
"name": "raf",
"version": "2.0.4",
"version": "3.0.0",
"description": "requestAnimationFrame polyfill for node and the browser",

@@ -26,3 +26,3 @@ "main": "index.js",

"browserify": "~4.1.2",
"tape": "~2.12.3"
"tape": "^4.0.0"
},

@@ -29,0 +29,0 @@ "dependencies": {

@@ -45,1 +45,19 @@ var test = require('tape')

})
test('raf should throw on errors', function(t) {
t.plan(1)
var onError = function() {
t.pass('error bubbled up to event loop')
}
if(typeof window !== 'undefined') {
window.onerror = onError
} else if(typeof process !== 'undefined') {
process.on('uncaughtException', onError)
}
raf(function() {
throw new Error('foo')
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc