Socket
Socket
Sign inDemoInstall

can-globals

Package Overview
Dependencies
3
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0-pre.1 to 0.0.0-pre.2

js/document/document.js

2

can-globals-test.js
'use strict';
var Globals = require('./can-globals-proto');
var QUnit = require('../../test-wrapper');
var QUnit = require('./test-wrapper');
var sinon = require('sinon');

@@ -5,0 +5,0 @@ var globals;

@@ -1,18 +0,39 @@

/* global window, document */
'use strict';
var global = require('./js/global/global')();
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
(function () {
if (typeof global.CustomEvent !== 'function') {
if (typeof global.createEvent !== 'function') {
global.createEvent = function() {
return {
initCustomEvent: function(event, bubbles, cancelable, detail){
return {
type: event,
bubbles: bubbles,
cancelable: cancelable,
detail: detail
};
}
};
};
}
if ( typeof window.CustomEvent === "function" ) return false;
/*jshint -W082*/
function CustomEvent (event, params) {
params = params || {bubbles: false, cancelable: false, detail: undefined};
var evt = global.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
}
function CustomEvent ( event, params ) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent( 'CustomEvent' );
evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
return evt;
}
if (typeof global.Event === 'function') {
CustomEvent.prototype = global.Event.prototype;
} else {
var event = global.createEvent('Event');
/*jshint -W103*/
CustomEvent.prototype = event.__proto__;
}
CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent;
})();
global.CustomEvent = CustomEvent;
}
'use strict';
var importMap = {
document: require('./document/document'),
global: require('./global/global'),
isBrowserWindow: require('./is-browser-window/is-browser-window')
isBrowserWindow: require('./is-browser-window/is-browser-window'),
location: require('./location/location')
};

@@ -6,0 +8,0 @@

'use strict';
require('./global/global-test');
require('./is-browser-window/is-browser-window-test');
require('./location/location-test');
{
"name": "can-globals",
"version": "0.0.0-pre.1",
"version": "0.0.0-pre.2",
"description": "This module provides a dependency injection container. Modules may define a key and specify a default value (which can be static, cached lazy, or dynamic lazy), but other code can set and reset the value as needed. There is also an event system, for alerting on value changes, both specific to a key and for any key.",

@@ -5,0 +5,0 @@ "main": "can-globals.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc