Socket
Socket
Sign inDemoInstall

webidl2js

Package Overview
Dependencies
4
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.3.3 to 5.0.0

.vscode/settings.json

16

lib/constructs/attribute.js

@@ -19,3 +19,3 @@ "use strict";

const configurable = utils.getExtAttr(this.idl.extAttrs, "Unforgeable") ? "false" : "true";
const configurable = !utils.getExtAttr(this.idl.extAttrs, "Unforgeable");
const shouldReflect = utils.getExtAttr(this.idl.extAttrs, "Reflect");

@@ -25,3 +25,3 @@

let definedOn = this.obj.name + (this.idl.static ? "" : ".prototype");
if (configurable === "false") { // we're in a setup method and define an Unforgeable attribute
if (!configurable || utils.isGlobal(this.interface)) { // we're in a setup method
objName = `obj`;

@@ -66,6 +66,16 @@ definedOn = `obj`;

},`;
} else if (utils.getExtAttr(this.idl.extAttrs, "Replaceable")) {
str += `
set(V) {
Object.defineProperty(this, "${this.idl.name}", {
configurable: true,
enumerable: true,
value: V,
writable: true
});
},`;
}
str += `
enumerable: true,
configurable: ${configurable}
configurable: ${JSON.stringify(configurable)}
});\n\n`;

@@ -72,0 +82,0 @@

4

lib/constructs/interface.js

@@ -184,3 +184,3 @@ "use strict";

const memberIdl = this.idl.members[i];
if (memberIdl.type === "attribute" && utils.getExtAttr(memberIdl.extAttrs, "Unforgeable")) {
if (memberIdl.type === "attribute" && (utils.getExtAttr(memberIdl.extAttrs, "Unforgeable") || utils.isGlobal(this.idl))) {
const member = new Attribute(this, this.idl, memberIdl);

@@ -258,3 +258,3 @@ this.str += "\n " + member.generate().body.replace(/\n/g, '\n ');

case "attribute":
if (utils.getExtAttr(memberIdl.extAttrs, "Unforgeable")) {
if (utils.getExtAttr(memberIdl.extAttrs, "Unforgeable") || utils.isGlobal(this.idl)) {
break;

@@ -261,0 +261,0 @@ }

@@ -11,2 +11,8 @@ "use strict";

return null;
};
};
module.exports.isGlobal = function isGlobal(idl) {
const isGlobal = !!module.exports.getExtAttr(idl.extAttrs, "Global") ||
!!module.exports.getExtAttr(idl.extAttrs, "PrimaryGlobal");
return isGlobal;
};
{
"name": "webidl2js",
"version": "4.3.3",
"version": "5.0.0",
"description": "Auto-generates class structures for WebIDL specifications",
"main": "index.js",
"main": "lib/transformer.js",
"dependencies": {
"fs-extra": "~0.23.1",
"webidl2": "^2.0.11",
"webidl-conversions": "^2.0.0"
"co": "^4.6.0",
"pn": "^1.0.0",
"webidl-conversions": "^2.0.0",
"webidl2": "^2.0.11"
},

@@ -11,0 +12,0 @@ "devDependencies": {},

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