-
Type:
Enhancement
-
Resolution: Won't Fix
-
Priority:
P4
-
Affects Version/s: 6u7
-
Component/s: core-libs
-
x86
-
windows_vista
E:\alcatel\borsotti\jtest>java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
Does this problem occur on J2SE 1.4.x or 5.0.x ? Yes / No (pick one)
Not known
Operating System Configuration Information (be specific):
Windows Vista
SP1
Hardware Configuration Information (be specific):
AMD Athlon X2-64 2Gb RAM
Bug Description:
The java scripting API does not allow to tell the engine the file
and line number on which scripts are. Consequently, the engine cannot
report errors with a meaningful indication of the error place.
Often, scripts are embedded in other files. E.g. consider the following
html file:
<body>
<script>
function f1(){
bla; bla
}
</script>
This is an example
<script>
function f2(){
bla; bla
}
f1()
</script>
</body>
A java program that has to process it extracts the scripts and feds them
to the scripting engine. However, it has no way to tell the line numbers
where they appear in the file. When the engine finds an error, it tells
a line number on which it has found it that is relative to the piece of
script in error, not to the entire file. This is so because the engine restarts
numbering lines each time its eval() method is called.
Firefox reports the errors with the correct line numbers, however. This means
that it has a way to inform the engine about that.
Remedy: provide a method in ScriptEngine to tell the line number and file name
where the next script passed to eval() is located.
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
Does this problem occur on J2SE 1.4.x or 5.0.x ? Yes / No (pick one)
Not known
Operating System Configuration Information (be specific):
Windows Vista
SP1
Hardware Configuration Information (be specific):
AMD Athlon X2-64 2Gb RAM
Bug Description:
The java scripting API does not allow to tell the engine the file
and line number on which scripts are. Consequently, the engine cannot
report errors with a meaningful indication of the error place.
Often, scripts are embedded in other files. E.g. consider the following
html file:
<body>
<script>
function f1(){
bla; bla
}
</script>
This is an example
<script>
function f2(){
bla; bla
}
f1()
</script>
</body>
A java program that has to process it extracts the scripts and feds them
to the scripting engine. However, it has no way to tell the line numbers
where they appear in the file. When the engine finds an error, it tells
a line number on which it has found it that is relative to the piece of
script in error, not to the entire file. This is so because the engine restarts
numbering lines each time its eval() method is called.
Firefox reports the errors with the correct line numbers, however. This means
that it has a way to inform the engine about that.
Remedy: provide a method in ScriptEngine to tell the line number and file name
where the next script passed to eval() is located.