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

Change the name of argument in repeat function to resolve problem optimizing #14

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
14 changes: 7 additions & 7 deletions jlinq.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,23 +214,23 @@ var jl;

//repeats the previous command with new
//arguments
repeat:function(arguments) {
repeat:function(args) {

//check if there is anything to repeat
if (!self.instance.lastCommand || arguments == null) { return; }
if (!self.instance.lastCommand || args == null) { return; }

//get the array of arguments to work with
arguments = framework.util.toArray(arguments);
args = framework.util.toArray(args);

//check if there is a field name has changed, and
//if so, update the arguments to match
if (self.canRepeatCommand(arguments)) {
self.instance.lastField = arguments[0];
arguments = framework.util.select(arguments, null, 1, null);
if (self.canRepeatCommand(args)) {
self.instance.lastField = args[0];
args = framework.util.select(args, null, 1, null);
}

//invoke the command now
self.queue(self.instance.lastCommand, arguments);
self.queue(self.instance.lastCommand, args);
},

//saves a command to evaluate later
Expand Down