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

Drop non-standard <function>.name assigning #584

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: 3 additions & 9 deletions slick.dataview.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,15 +598,13 @@

function compileAccumulatorLoop(aggregator) {
var accumulatorInfo = getFunctionInfo(aggregator.accumulate);
var fn = new Function(
return new Function(
"_items",
"for (var " + accumulatorInfo.params[0] + ", _i=0, _il=_items.length; _i<_il; _i++) {" +
accumulatorInfo.params[0] + " = _items[_i]; " +
accumulatorInfo.body +
"}"
);
fn.displayName = fn.name = "compiledAccumulatorLoop";
return fn;
}

function compileFilter() {
Expand Down Expand Up @@ -636,9 +634,7 @@
tpl = tpl.replace(/\$item\$/gi, filterInfo.params[0]);
tpl = tpl.replace(/\$args\$/gi, filterInfo.params[1]);

var fn = new Function("_items,_args", tpl);
fn.displayName = fn.name = "compiledFilter";
return fn;
return new Function("_items,_args", tpl);
}

function compileFilterWithCaching() {
Expand Down Expand Up @@ -672,9 +668,7 @@
tpl = tpl.replace(/\$item\$/gi, filterInfo.params[0]);
tpl = tpl.replace(/\$args\$/gi, filterInfo.params[1]);

var fn = new Function("_items,_args,_cache", tpl);
fn.displayName = fn.name = "compiledFilterWithCaching";
return fn;
return new Function("_items,_args,_cache", tpl);
}

function uncompiledFilter(items, args) {
Expand Down