~statik/v8/couchdb

« back to all changes in this revision

Viewing changes to test/mjsunit/delete-vars-from-eval.js

  • Committer: mads.s.ager at gmail
  • Date: 2008-09-01 07:55:01 UTC
  • Revision ID: svn-v3-trunk0:ce2b1a6d-e550-0410-aec6-3dcde31c8c00:trunk:60
Included mjsunit JavaScript test suite and C++ unit tests.

Changed the shell sample to not print the result of executing a script provided on the command line.

Fixed issue when building samples on Windows using a shared V8 library.  Added visibility option on Linux build which makes the generated library 18% smaller.

Changed build system to accept multiple build modes in one build and generate separate objects, libraries and executables for each mode.

Removed deferred negation optimization (a * -b => -(a * b)) since this visibly changes operand conversion order.

Improved parsing performance by introducing stack guard in preparsing.  Without a stack guard preparsing always bails out with stack overflow.

Changed shell sample to take flags directly from the command-line. Added API call that implements this.

Added load, quit and version functions to the shell sample so it's easier to run benchmarks and tests.

Fixed issue with building samples and cctests on 64-bit machines.

Fixed bug in the runtime system where the prototype chain was not always searched for a setter when setting a property that does not exist locally.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2008 Google Inc. All Rights Reserved.
 
2
// Redistribution and use in source and binary forms, with or without
 
3
// modification, are permitted provided that the following conditions are
 
4
// met:
 
5
//
 
6
//     * Redistributions of source code must retain the above copyright
 
7
//       notice, this list of conditions and the following disclaimer.
 
8
//     * Redistributions in binary form must reproduce the above
 
9
//       copyright notice, this list of conditions and the following
 
10
//       disclaimer in the documentation and/or other materials provided
 
11
//       with the distribution.
 
12
//     * Neither the name of Google Inc. nor the names of its
 
13
//       contributors may be used to endorse or promote products derived
 
14
//       from this software without specific prior written permission.
 
15
//
 
16
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
17
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
18
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
19
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
20
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
21
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
22
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
23
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
24
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
25
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
26
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
27
 
 
28
// Variable declarations in eval() must introduce delete-able vars;
 
29
// even when they are local to a function.
 
30
(function() {
 
31
  eval("var tmp0 = 0");
 
32
  assertEquals(0, tmp0);
 
33
  assertTrue(delete tmp0);
 
34
  assertTrue(typeof(tmp0) == 'undefined');
 
35
})();
 
36
 
 
37
eval("var tmp1 = 1");
 
38
assertEquals(1, tmp1);
 
39
assertTrue(delete tmp1);
 
40
assertTrue(typeof(tmp1) == 'undefined');