Socket
Socket
Sign inDemoInstall

link

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

link - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

Tests/nodejs/define-this.js

4

package.json
{
"name" : "link",
"version" : "0.1.3",
"version" : "0.1.4",
"description" : "Module runtime and converter for Labeled Modules, CommonJS and AMD.",

@@ -14,3 +14,3 @@ "homepage" : "http://github.com/calyptus/link.js",

"dependencies" : {},
"engines" : { "node": "> 0.4.x < 0.7.0" },
"engines" : { "node": "> 0.4.x < 0.9.0" },
"repository" : {"type": "git", "url": "git://github.com/calyptus/link.js.git"},

@@ -17,0 +17,0 @@ "main" : "./Source/Node/link.js",

@@ -1,2 +0,2 @@

version: 0.12;
version: 0.14;

@@ -384,3 +384,3 @@ (function(){

return typeof token === 'undefined' ||
(token.type === Punctuator && '!(=:,[{++--;&&||^'.indexOf(token.value) >= 0) ||
(token.type === Punctuator && '})]'.indexOf(token.value) == -1) ||
(token.type === Keyword && isKeyword(token.value));

@@ -532,3 +532,4 @@ }

ch = source[index];
if (isWhiteSpace(ch) || isLineTerminator(ch) || isPunctuator(ch)) // "'?
if (isWhiteSpace(ch) || isLineTerminator(ch) || isPunctuator(ch) ||
ch == '\'' || ch == '"')
break;

@@ -535,0 +536,0 @@ id += nextChar();

#!/usr/bin/env node
version: 0.12;
version: 0.14;

@@ -4,0 +4,0 @@ // TODO: Enable clean debugging by keeping runtime boilerplate within the 62 characters Node does.

@@ -1,2 +0,2 @@

version: 0.12;
version: 0.14;

@@ -284,3 +284,3 @@ (function(debuggableRun, simpleRun, getGlobal){

required.push(require(deps[i]));
factory = factory.apply(exports, required);
factory = factory.apply(module.exports, required);
}

@@ -287,0 +287,0 @@ if (factory && id){

@@ -324,2 +324,10 @@ with(require('../Source/Node/link'))

it("should allow a define factory without dependencies", function(){
expect(require('./nodejs/simple-define').exported).toEqual('object');
});
it("should allow a factory without dependencies to assign to this", function(){
expect(require('./nodejs/define-this').exported).toEqual('object');
});
});

@@ -326,0 +334,0 @@

@@ -41,3 +41,5 @@ if (typeof require !== 'undefined') var parse = require('../Source/Library/link').parse;

default: {
ebar = bah && /regexp/.test("string");
ebar = bah && /regexp/.test("string")
? /regexp/ : !/regexp/;
return"string"
}

@@ -56,3 +58,3 @@ }

// Avoid browser dead code elimination
sample = "foo;\n var foo = function named(){};\n bar = 2\n\n labeled: function bah(){\n var x,z;\n y = 10;\n }\n\n bah = foo;\n\n exports: var efoo, ebar;\n\n var someVariable = {\n obj: initializer,\n obj2: function(a,b){\n return function(){\n exports.foobar = '';\n exports.fooz = 2;\n return a / b / c;\n }\n var c;\n }\n }, someOtherVariable\n\n exports.nooz = 'zoon';\n\n exports: bar;\n\n foo();\n\n exports: function foobar(){\n exports: function shouldNotFindThis(){}\n }\n ";
sample = "foo;\n var foo = function named(){};\n bar = 2\n\n labeled: function bah(){\n var x,z;\n y = 10;\n }\n\n bah = foo;\n\n exports: var efoo, ebar;\n\n var someVariable = {\n obj: initializer,\n obj2: function(a,b){\n return function(){\n exports.foobar = '';\n exports.fooz = 2;\n return a / b / c;\n }\n var c;\n }\n }, someOtherVariable\n\n switch (\"x\"){\n case \"x\": {\n exports.nooz = 'zoon';\n }\n default: {\n ebar = bah && /regexp/.test(\"string\")\n ? /regexp/ : !/regexp/;\n return\"string\"\n }\n }\n\nexports: bar;\n\n foo();\n\n exports: function foobar(){\n exports: function shouldNotFindThis(){}\n }\n ";

@@ -71,2 +73,3 @@ it('should find all declared global variables', function(){

var module = parse(sample);
console.log(module.expectedVariables);
expect(module.expectedVariables.length).toEqual(4);

@@ -92,3 +95,3 @@ });

var module = parse(sample);
expect(module.tokens.length).toEqual(13 + 3 + 3 + 2 + 3);
expect(module.tokens.length).toEqual(13 + 3 + 3 + 2 + 2 + 3);
});

@@ -95,0 +98,0 @@ });

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