Reviewers: Jakob,

Description:
Work around nifty VS10 compiler bug

VS10 generates bogus code for specific arguments to the Number::New function
when invoked in specific places of an ExpectRecords array definition, passing a
garbage value to the function (as printf debugging reveals). Changing the
argument from 1 to 7 apparently circumvents the problem.

[email protected]
BUG=


Please review this at https://codereview.chromium.org/12212108/

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

Affected files:
  M test/cctest/test-object-observe.cc


Index: test/cctest/test-object-observe.cc
diff --git a/test/cctest/test-object-observe.cc b/test/cctest/test-object-observe.cc index 190bbb29ca18636033557264cc72b2705a56d270..7fc5bf765d2d7e815bf0d9c1613d5c249a7e3239 100644
--- a/test/cctest/test-object-observe.cc
+++ b/test/cctest/test-object-observe.cc
@@ -325,7 +325,7 @@ TEST(APITestBasicMutation) {
       "function observer(r) { [].push.apply(records, r); };"
       "Object.observe(obj, observer);"
       "obj"));
-  obj->Set(String::New("foo"), Number::New(1));
+  obj->Set(String::New("foo"), Number::New(7));
   obj->Set(1, Number::New(2));
   // ForceSet should work just as well as Set
   obj->ForceSet(String::New("foo"), Number::New(3));
@@ -345,7 +345,9 @@ TEST(APITestBasicMutation) {
   const RecordExpectation expected_records[] = {
     { obj, "new", "foo", Handle<Value>() },
     { obj, "new", "1", Handle<Value>() },
-    { obj, "updated", "foo", Number::New(1) },
+ // Note: use 7 not 1 below, as the latter triggers a nifty VS10 compiler bug + // where instead of 1.0, a garbage value would be passed into Number::New.
+    { obj, "updated", "foo", Number::New(7) },
     { obj, "updated", "1", Number::New(2) },
     { obj, "updated", "1", Number::New(4) },
     { obj, "new", "1.1", Handle<Value>() },


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to