Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
runat-1128988: Having functions called 'eval' seems dangerous
Browse files Browse the repository at this point in the history
I tried using GCLI from babel and it didn't like to have functions
called 'eval'. It looks legal under ES5 'strict mode' to me, but I don't
think eval is a good name all the same.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
  • Loading branch information
joewalker committed Mar 17, 2015
1 parent de35726 commit 4dc4581
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions lib/gcli/languages/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ exports.items = [
},

exec: function(input) {
return this.eval(input).then(function(response) {
// console.log('javascript.exec', response);
return this.evaluate(input).then(function(response) {
var output = (response.exception != null) ?
response.exception.class :
response.output;
Expand Down Expand Up @@ -80,8 +79,8 @@ exports.items = [
}.bind(this));
},

eval: function(input) {
return host.script.eval(input);
evaluate: function(input) {
return host.script.evaluate(input);
}
}
];
2 changes: 1 addition & 1 deletion lib/gcli/util/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ exports.script = {
useTarget: function(tgt) { },

// Execute some JavaScript
eval: function(javascript) {
evaluate: function(javascript) {
try {
return Promise.resolve({
input: javascript,
Expand Down
2 changes: 1 addition & 1 deletion web/gcli/util/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ exports.script = {
useTarget: function(tgt) { },

// Execute some JavaScript
eval: function(javascript) {
evaluate: function(javascript) {
try {
return Promise.resolve({
input: javascript,
Expand Down

1 comment on commit 4dc4581

@bgrins
Copy link

@bgrins bgrins commented on 4dc4581 Mar 19, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

Please sign in to comment.