11489 Commits

Author SHA1 Message Date
nboyd%atg.com
2f4c9e82e4 Remove unused imports.
git-svn-id: svn://10.0.0.236/trunk@257789 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-24 13:57:40 +00:00
nboyd%atg.com
cdfa99a296 Fix Bug 505862 - Implement Array.isArray
Patch from Raphael Speyer


git-svn-id: svn://10.0.0.236/trunk@257784 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-24 01:26:14 +00:00
nboyd%atg.com
28a9737eea Patch from Robert Bowdidge:
Improve position accuracy in Rhino parser.

These changes continue to improve position accuracy in the
older Node parse tree nodes, primarily for expressions.  The
changes do the following:

* Set the line number of infix operations to the line where
the operator appears, not where the overall expression begins.

* Fix memberExprTail to mark function calls on the line where
the left paren enclosing the expressions appears, rather than
where the name appears.

* Ensure that position information is gathered for
objectLiteral property lists, and that the key and value both
get accurate line information.

* Mark all string literal nodes with the line where the string appears.

These changes should help anyone reporting error messages
based on the lineno field of a Node or doing any other
position-sensitive operations with nodes.

Background:

Before the 11/2008 submission of the new AstNode parse tree,
line numbers were recorded only for statements, not for
expressions.  Steve Yegge's new changes added line number
information for many nodes, and also added more precise
information to the new ASTnodes based on absolute offset in the
text stream.

One drawback of the line number information for plain Nodes is
that it follows the AstNode's convention of having the
position mark the start of the expression.  This matches the
behavior of positions in AstNode where intermediate points of
interest (the operator in an infix binary expression, or the
parentheses in a function call) are also remembered as offsets from
the beginning of the overall expression.

However, this causes problems for anyone using the older Node parse
tree because naive code generating errors or source mappings
only have access to the stored line number, and might point at code
multiple lines away from the actual source of the problem.  An
error in a multi-line condition would point to the beginning
of the condition, or a caller trying to show the location of a
function call would point at the beginning of the name
representing the function, even if that name were a few lines
away.  We see a bunch of these multi-line expressions in our
own source code, and an unchanged Rhino would direct programmers
at the wrong line for the error.

Following the convention that the line number always
represents the line of the most representative "token" not
only helps understanding, but gives better information.  We
can still find the entire range of the expression by looking
at the lines of all sub-expressions, and we can find the line
and column of an arbitrary interesting Node quickly by
assuming the line number is correct, then looking at the file
at the absolute position given by the AstNode, and searching
backwards in the text for a carriage return.

I searched a bit in the Rhino sources for clients of getLineno()
who might be affected by these changes, and didn't see any obvious
cases where these changes might cause problems.


git-svn-id: svn://10.0.0.236/trunk@257776 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-23 12:04:14 +00:00
nboyd%atg.com
5c0eb81bd7 Fix javadoc.
git-svn-id: svn://10.0.0.236/trunk@257764 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-22 14:01:07 +00:00
nboyd%atg.com
9a43759f3c Don't depend on Locale.ROOT, which requires JDK 1.6.
git-svn-id: svn://10.0.0.236/trunk@257763 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-22 12:31:57 +00:00
nboyd%atg.com
d2c1b16b8b Remove unused imports.
git-svn-id: svn://10.0.0.236/trunk@257762 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-22 12:18:05 +00:00
nboyd%atg.com
75614c3f18 Adds the JSON built-in object
See bug 505211
Contributed by Raphael Speyer


git-svn-id: svn://10.0.0.236/trunk@257761 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-22 12:15:22 +00:00
nboyd%atg.com
6417de6103 Actually disable this test.
git-svn-id: svn://10.0.0.236/trunk@257747 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-21 17:39:05 +00:00
nboyd%atg.com
372933aa9e Add credit for the fix of 505299.
git-svn-id: svn://10.0.0.236/trunk@257745 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-21 16:58:06 +00:00
nboyd%atg.com
6890620543 Fix Bug 505299 - String.to{Upper,Lower}Case broken in Turkish locale
git-svn-id: svn://10.0.0.236/trunk@257744 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-21 16:55:11 +00:00
nboyd%atg.com
f1e52444c0 Make Object.getOwnPropertyDescriptor work for members of builtin objects
Previously Object.getOwnPropertyDescriptor(Math, "PI") returned undefined.

This patch makes the members of builtin objects have descriptors with
Writable=true, Enumerable=false, Configurable=true for function properties, and
Writable=false, Enumerable=false, Configurable=false for non-function
properties

See https://bugzilla.mozilla.org/show_bug.cgi?id=489329


git-svn-id: svn://10.0.0.236/trunk@257741 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-21 00:42:06 +00:00
nboyd%atg.com
dde158ec11 Allow Object.create to accept null as a first argument
git-svn-id: svn://10.0.0.236/trunk@257740 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-21 00:35:28 +00:00
nboyd%atg.com
3249bb3c87 Fix warnings.
git-svn-id: svn://10.0.0.236/trunk@257739 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-21 00:27:59 +00:00
nboyd%atg.com
660a561dfc Changes necessary to get "ant junit-all" to run successfully.
git-svn-id: svn://10.0.0.236/trunk@257717 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-16 15:17:49 +00:00
nboyd%atg.com
f7fa4192c3 Add two more line number tests.
git-svn-id: svn://10.0.0.236/trunk@257710 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-15 20:26:01 +00:00
nboyd%atg.com
4ae1785e0c Make getOwnPropertyDescriptor and defineProperty work property for arrays.
Allows getting and setting attributes on index properties when the array is in
dense mode.


git-svn-id: svn://10.0.0.236/trunk@257702 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-15 15:47:58 +00:00
nboyd%atg.com
4c9c1ecf9f This is a set of changes to Rhino to correctly add line number
information to more nodes.
Patch from Robert Bowdidge.


git-svn-id: svn://10.0.0.236/trunk@257681 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-09 18:46:53 +00:00
nboyd%atg.com
3660af1e0c Move cheaper tests earlier to improve efficiency.
git-svn-id: svn://10.0.0.236/trunk@257668 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-08 16:55:54 +00:00
szegedia%freemail.hu
c3b6d2f5d1 Upgraded to Retrotranslator 1.2.8
git-svn-id: svn://10.0.0.236/trunk@257637 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-06 13:57:13 +00:00
mrbkap%gmail.com
3beff105d6 Bug 455633 - Protect against the weird Sandbox global object case when creating XPCNativeWrappers. r+sr=bzbarsky a=dveditz
git-svn-id: svn://10.0.0.236/trunk@257634 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-06 05:57:37 +00:00
nboyd%atg.com
60d4dfa119 Fix Bug 492367 - Some function calls cause lots of execution stack information in interpreted mode
Patch from Marc Guillemot.


git-svn-id: svn://10.0.0.236/trunk@257628 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-04 12:14:53 +00:00
nboyd%atg.com
d17c8291af Fix Bug 487599 - NativeArray: improve performance of sort([fn]) using java's Arrays.sort(..)
Patch from Marc Guillemot.


git-svn-id: svn://10.0.0.236/trunk@257624 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-03 02:10:37 +00:00
nboyd%atg.com
e8b6804508 Fix Bug 501972 - parseFloat doesn't correctly trim leading white spaces
Patch from Marc Guillemot


git-svn-id: svn://10.0.0.236/trunk@257623 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-03 01:21:21 +00:00
mrbkap%gmail.com
38e969842e Bug 501270 - Make pseudo-frames have call objects if they're around a heaveyweight function to preserve engine invariants. r=brendan a=dveditz
git-svn-id: svn://10.0.0.236/trunk@257619 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-01 20:18:31 +00:00
nboyd%atg.com
60a72c03b0 Don't let JSDoc attachments spill outside a function.
Patch from Nada Amin.


git-svn-id: svn://10.0.0.236/trunk@257607 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-29 12:23:33 +00:00
dveditz%cruzio.com
9722e8e709 bug 440982 only get script hook if we're going to call it, to avoid possible calls back into script under JS_GC's notification. r/sr=brendan, a=dveditz
git-svn-id: svn://10.0.0.236/trunk@257586 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-25 21:14:03 +00:00
nboyd%atg.com
db4b7134da Remove comment suggesting a nonstandard change
git-svn-id: svn://10.0.0.236/trunk@257585 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-25 19:47:26 +00:00
mrbkap%gmail.com
407a1f1f43 Bug 481434 - Fix up the logic a bit. r+sr=bzbarsky a=ss
git-svn-id: svn://10.0.0.236/trunk@257583 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-25 06:58:18 +00:00
mrbkap%gmail.com
a3d3acbb16 Bug 460882. r+sr=jst.
git-svn-id: svn://10.0.0.236/trunk@257562 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-24 02:30:25 +00:00
igor%mir2.org
1f68049513 bug 488995, r=mrbkap,sr=jst,a1.9.0.12=ss
git-svn-id: svn://10.0.0.236/trunk@257561 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-23 20:27:33 +00:00
igor%mir2.org
2a15b89ffd bug 454704 - patch from Jim Blandy, r=myself, a1.9.0.12=ss
git-svn-id: svn://10.0.0.236/trunk@257560 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-23 20:24:11 +00:00
igor%mir2.org
a8e486f0d8 backing out the patch for bug 488995 due to build failure on windows
git-svn-id: svn://10.0.0.236/trunk@257559 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-23 18:56:41 +00:00
igor%mir2.org
63a8fd8863 bug 488995, r=mrbkap,sr=jst,a1.9.0.12=dveditz
git-svn-id: svn://10.0.0.236/trunk@257557 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-23 14:46:14 +00:00
nboyd%atg.com
812bc9fd45 Implement ES5 seal, isSealed, freeze and isFrozen
git-svn-id: svn://10.0.0.236/trunk@257548 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-22 01:08:22 +00:00
nboyd%atg.com
2343b22891 Fix bug in line numbers for captured comments
Patch from Nada Amin


git-svn-id: svn://10.0.0.236/trunk@257531 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-18 20:43:57 +00:00
jwalden%mit.edu
a7f507ad90 Bug 465980 - Some array methods don't work right on ginormous arrays. r=jorendorff, a=dveditz
git-svn-id: svn://10.0.0.236/trunk@257524 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-17 22:59:55 +00:00
Olli.Pettay%helsinki.fi
e0860f9cc0 Bug 461861, r+sr=mrbkap, a=dveditz
git-svn-id: svn://10.0.0.236/trunk@257490 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-14 14:31:37 +00:00
nboyd%atg.com
e28c614fba ES5: create, defineProperty and defineProperties
Patch from Raphael Speyer


git-svn-id: svn://10.0.0.236/trunk@257475 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-12 11:47:23 +00:00
nboyd%atg.com
5b406e7024 Fix bug: "in" operator in the midst of for inititalizer confused parser
Patch from Nada Amin


git-svn-id: svn://10.0.0.236/trunk@257453 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-10 01:09:18 +00:00
nboyd%atg.com
b6b5ad46e3 Fix for bug 496585 "Regression in overload resolution"
git-svn-id: svn://10.0.0.236/trunk@257445 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-09 17:43:47 +00:00
nboyd%atg.com
c16b7533b5 Set lineno when parsing assignments. Patch from Nada Amin.
git-svn-id: svn://10.0.0.236/trunk@257439 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-09 13:00:44 +00:00
szegedia%freemail.hu
c528b0d288 Fix for #494665: Memory leak when using Java reflection & shared scopes
git-svn-id: svn://10.0.0.236/trunk@257428 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-06 14:11:24 +00:00
nboyd%atg.com
95aabea269 Bug 489329 - implement new Object constructor methods from ecmascript 5 spec
git-svn-id: svn://10.0.0.236/trunk@257419 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-05 12:08:59 +00:00
hannes%helma.at
ea75ea7104 Workaround fix for bug 492036 - New AST code throws codebug on certain forms of destructuring assignment
git-svn-id: svn://10.0.0.236/trunk@257378 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-03 14:47:13 +00:00
nboyd%atg.com
f6f233adf0 Fix NPE in parsing comments if source is coming from a Reader instead of
a String.


git-svn-id: svn://10.0.0.236/trunk@257377 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-03 12:51:43 +00:00
nboyd%atg.com
5a3ba2964d Fix bug 495785 - Rhino interpreter shell crashes with NullPointerException
git-svn-id: svn://10.0.0.236/trunk@257341 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-02 01:44:15 +00:00
nboyd%atg.com
f66bd9dff3 enable calling of new JUnit tests
git-svn-id: svn://10.0.0.236/trunk@257295 18797224-902f-48f8-a5cc-f745e15eee43
2009-05-28 12:10:42 +00:00
nboyd%atg.com
7564ea8146 Miscellaneous AST bug fixes:
Fixed incorrect node positions for labeled statements and finally blocks.

Labels: when parsing a labeled loop, we set the loop's parent to the
LabeledStatement before parsing the loop's children, which messes up
their offsets. Worked around the problem by temporarily adjusting the
loop's position while parsing the children.

Try statements had two bugs:
  - the parser was setting the 'finally' keyword's position incorrectly
    (wasn't setting it relative to parent)
  - the toSource() method threw a NullPointerException for a
    try/finally block with no catch clauses.

Also fixed AstNode.setParent() to un-relativize the node's position if
the node already had a parent. This doesn't happen in Rhino's parser, but
if users are doing tree rewrites they could have run into bad offsets.

Patch from Steve Yegge


git-svn-id: svn://10.0.0.236/trunk@257294 18797224-902f-48f8-a5cc-f745e15eee43
2009-05-27 17:29:06 +00:00
nboyd%atg.com
a45aee6384 Implement new Object constructor methods from ecmascript 5
Fixes bug 489329
Patch by Raphael Speyer


git-svn-id: svn://10.0.0.236/trunk@257293 18797224-902f-48f8-a5cc-f745e15eee43
2009-05-27 16:47:16 +00:00
nboyd%atg.com
d226378e09 Remove obsolete assertion as underlying problem has been resolved. Add
tests back.


git-svn-id: svn://10.0.0.236/trunk@257291 18797224-902f-48f8-a5cc-f745e15eee43
2009-05-27 12:24:48 +00:00