Fix bug 6063.

This commit is contained in:
norris%netscape.com 2000-03-01 21:35:38 +00:00
parent 0b2ace1273
commit a74b41a9c1
2 changed files with 6 additions and 8 deletions

View File

@ -263,7 +263,7 @@ public class NativeFunction extends ScriptableObject implements Function {
if (!justbody) {
result.append("function ");
/* version < 1.2 Function constructor behavior - if
/* version != 1.2 Function constructor behavior - if
* there's no function name in the source info, and
* the names[0] entry is the empty string, then it must
* have been created by the Function constructor;
@ -275,7 +275,7 @@ public class NativeFunction extends ScriptableObject implements Function {
if (nextIs(i, TokenStream.LP)
&& this.version != Context.VERSION_1_2
&& this.names != null
&& this.names[0].length() == 0)
&& this.names[0].equals("anonymous"))
result.append("anonymous");
i++;
} else {
@ -899,8 +899,7 @@ public class NativeFunction extends ScriptableObject implements Function {
if (fn.names == null)
fn.names = new String[1];
fn.names[0] = "";
fn.names[0] = "anonymous";
fn.setPrototype(getFunctionPrototype(global));
fn.setParentScope(global);

View File

@ -263,7 +263,7 @@ public class NativeFunction extends ScriptableObject implements Function {
if (!justbody) {
result.append("function ");
/* version < 1.2 Function constructor behavior - if
/* version != 1.2 Function constructor behavior - if
* there's no function name in the source info, and
* the names[0] entry is the empty string, then it must
* have been created by the Function constructor;
@ -275,7 +275,7 @@ public class NativeFunction extends ScriptableObject implements Function {
if (nextIs(i, TokenStream.LP)
&& this.version != Context.VERSION_1_2
&& this.names != null
&& this.names[0].length() == 0)
&& this.names[0].equals("anonymous"))
result.append("anonymous");
i++;
} else {
@ -899,8 +899,7 @@ public class NativeFunction extends ScriptableObject implements Function {
if (fn.names == null)
fn.names = new String[1];
fn.names[0] = "";
fn.names[0] = "anonymous";
fn.setPrototype(getFunctionPrototype(global));
fn.setParentScope(global);