Reviewers: Mads Ager,

Message:
Make the tree less tired.

Description:
Change the tests which looks at the number of scripts in the VM after
startup to ignore native scripts without name.

Native scripts without name are currently only the script holding the
empty script and the script holding the source for the empty function.
These two unnamed scripts are created for each context. When running
with snapshot an additional context is created during startup adding two
more native scripts that in the non-snapshot case.

Please review this at http://codereview.chromium.org/39333

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     test/mjsunit/debug-script.js


Index: test/mjsunit/debug-script.js
===================================================================
--- test/mjsunit/debug-script.js        (revision 1443)
+++ test/mjsunit/debug-script.js        (working copy)
@@ -33,28 +33,26 @@
  RegExp();

  // Count script types.
-var native_count = 0;
+var named_native_count = 0;
  var extension_count = 0;
  var normal_count = 0;
  var scripts = Debug.scripts();
  for (i = 0; i < scripts.length; i++) {
    if (scripts[i].type == Debug.ScriptType.Native) {
-    native_count++;
+    if (scripts[i].name) {
+      named_native_count++;
+    }
    } else if (scripts[i].type == Debug.ScriptType.Extension) {
      extension_count++;
    } else if (scripts[i].type == Debug.ScriptType.Normal) {
-    if (!scripts[i].name) print("X" + scripts[i].source + "X"); // empty  
script
-    else {
-      print(scripts[i].name);
-      normal_count++;
-      }
+    normal_count++;
    } else {
      assertUnreachable('Unexpected type ' + scripts[i].type);
    }
  }

  // This has to be updated if the number of native scripts change.
-assertEquals(16, native_count);
+assertEquals(12, named_native_count);
  // If no snapshot is used, only the 'gc' extension is loaded.
  // If snapshot is used, all extensions are cached in the snapshot.
  assertTrue(extension_count == 1 || extension_count == 5);



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to