Revision: 13637
Author:   [email protected]
Date:     Mon Feb 11 04:28:22 2013
Log:      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=

Review URL: https://codereview.chromium.org/12212108
http://code.google.com/p/v8/source/detail?r=13637

Modified:
 /branches/bleeding_edge/test/cctest/test-object-observe.cc

=======================================
--- /branches/bleeding_edge/test/cctest/test-object-observe.cc Tue Feb 5 08:21:15 2013 +++ /branches/bleeding_edge/test/cctest/test-object-observe.cc Mon Feb 11 04:28:22 2013
@@ -325,7 +325,7 @@
       "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 @@
   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