Socket
Socket
Sign inDemoInstall

domv

Package Overview
Dependencies
91
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 3.0.0

30

lib/domv.js

@@ -29,5 +29,9 @@ 'use strict';

var slice = Array.prototype.slice;
var nameOverridesBuiltin = require('./name-overrides-builtin');
var Symbol = require('es6-symbol');
/* jshint -W064 */
var SHORTHAND_CACHE = Symbol('domv element shorthand cache');
/* jshint +W064 */
/** All of the valid node types in DOM (excluding the ones that are deprecated).

@@ -451,6 +455,6 @@ * @enum {number}

if (arguments.length === 2 &&
document.__domvShorthandCache__ &&
document.__domvShorthandCache__[tagName])
document[SHORTHAND_CACHE] &&
document[SHORTHAND_CACHE][tagName])
{
return document.__domvShorthandCache__[tagName];
return document[SHORTHAND_CACHE][tagName];
}

@@ -487,8 +491,8 @@

{
if (!document.__domvShorthandCache__)
if (!document[SHORTHAND_CACHE])
{
document.__domvShorthandCache__ = Object.create(null);
document[SHORTHAND_CACHE] = Object.create(null);
}
document.__domvShorthandCache__[tagName] = shorthandInstance;
document[SHORTHAND_CACHE][tagName] = shorthandInstance;
}

@@ -816,14 +820,2 @@

/**
* Does the given name potentially override a builtin property of `document` or `HTMLFormElement`?
* This list of invalid properties used by this method might not be exhaustive, this method is not intended
* to validate arbitrary user input.
* @param name Value of `name` or `id` attribute
* @return {Boolean} True if this name overrides a builtin property
*/
module.exports.nameOverridesBuiltin = function(name)
{
return nameOverridesBuiltin(name);
};
/**
* <p>The Node interface is the primary datatype for the entire Document Object Model.

@@ -830,0 +822,0 @@ * It represents a single node in the document tree. While all objects implementing

{
"name": "domv",
"version": "2.0.0",
"version": "3.0.0",
"author": "Joris van der Wel <joris@jorisvanderwel.com>",

@@ -38,2 +38,3 @@ "description": "Create views as components using DOM. Run the same code on the browser and on the server.",

"dependencies": {
"es6-symbol": "^2.0.1",
"inherits": "^2.0.1",

@@ -40,0 +41,0 @@ "throwable": "^1.0.3"

@@ -5,24 +5,2 @@ 'use strict';

function getAllPropertyNames()
{
var names = [];
for (var i = 0; i < arguments.length; ++i)
{
var obj = arguments[i];
while (obj)
{
names = names.concat(Object.getOwnPropertyNames(obj));
obj = Object.getPrototypeOf(obj);
}
}
names.sort();
return names.filter(function(name, index, names)
{
return index === 0 || names[index - 1] !== name;
});
}
function testParseHTMLDocumentResult(test, doc)

@@ -510,37 +488,3 @@ {

test.done();
},
'nameOverridesBuiltin': function(test)
{
getAllPropertyNames(this.document).forEach(function(name)
{
if (require('jsdom').jsdom && name[0] === '_')
{
// skip jsdom interal property
// (also, jsdom does not support [OverrideBuiltins] yet)
return;
}
test.ok(domv.nameOverridesBuiltin(name), name);
});
getAllPropertyNames(this.document.createElement('form')).forEach(function(name)
{
if (require('jsdom').jsdom && name[0] === '_')
{
// skip jsdom interal property
// (also, jsdom does not support [OverrideBuiltins] yet)
return;
}
test.ok(domv.nameOverridesBuiltin(name), name);
});
// a few random ones it should return false for
test.ok(!domv.nameOverridesBuiltin('foo'));
test.ok(!domv.nameOverridesBuiltin('firstchild')); // (wrong case)
test.ok(!domv.nameOverridesBuiltin('bar'));
test.ok(!domv.nameOverridesBuiltin(''));
test.done();
}
};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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