Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing unnecessary function parameters #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/jsio.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,13 +780,13 @@
}
}

function resolveImportRequest(context, request, opts) {
function resolveImportRequest(request) {
var cmds = jsio.__cmds,
imports = [],
result = false;

for (var i = 0, imp; imp = cmds[i]; ++i) {
if ((result = imp(context, request, opts, imports))) { break; }
if ((result = imp(request, imports))) { break; }
}

if (result !== true) {
Expand Down Expand Up @@ -838,7 +838,7 @@
var exportInto = opts.exportInto || boundContext || ENV.global;

// parse the import request(s)
var imports = resolveImportRequest(exportInto, request, opts),
var imports = resolveImportRequest(request),
numImports = imports.length,
retVal = numImports > 1 ? {} : null;

Expand Down Expand Up @@ -955,7 +955,7 @@

// from myPackage import myFunc
// external myPackage import myFunc
jsio.addCmd(function(context, request, opts, imports) {
jsio.addCmd(function(request, imports) {
var match = request.match(/^\s*(from|external)\s+([\w.\-$]+)\s+(import|grab)\s+(.*)$/);
if(match) {
imports.push({
Expand All @@ -973,7 +973,7 @@
});

// import myPackage
jsio.addCmd(function(context, request, opts, imports) {
jsio.addCmd(function(request, imports) {
var match = request.match(/^\s*import\s+(.*)$/);
if (match) {
match[1].replace(/\s*([\w.\-$]+)(?:\s+as\s+([\w.\-$]+))?,?/g, function(_, fullPath, as) {
Expand All @@ -991,7 +991,7 @@
});

// CommonJS syntax
jsio.addCmd(function(context, request, opts, imports) {
jsio.addCmd(function(request, imports) {

// ./../b -> ..b
// ../../b -> ...b
Expand Down