Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: test/cctest/test-api.cc

Issue 1094014: Merge the partial_snapshots branch back into bleeding_edge. For... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2007-2009 the V8 project authors. All rights reserved. 1 // Copyright 2007-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 20 matching lines...) Expand all
31 31
32 #include "api.h" 32 #include "api.h"
33 #include "compilation-cache.h" 33 #include "compilation-cache.h"
34 #include "execution.h" 34 #include "execution.h"
35 #include "snapshot.h" 35 #include "snapshot.h"
36 #include "platform.h" 36 #include "platform.h"
37 #include "top.h" 37 #include "top.h"
38 #include "utils.h" 38 #include "utils.h"
39 #include "cctest.h" 39 #include "cctest.h"
40 40
41 static const bool kLogThreading = false; 41 static const bool kLogThreading = true;
42 42
43 static bool IsNaN(double x) { 43 static bool IsNaN(double x) {
44 #ifdef WIN32 44 #ifdef WIN32
45 return _isnan(x); 45 return _isnan(x);
46 #else 46 #else
47 return isnan(x); 47 return isnan(x);
48 #endif 48 #endif
49 } 49 }
50 50
51 using ::v8::ObjectTemplate; 51 using ::v8::ObjectTemplate;
(...skipping 4546 matching lines...) Expand 10 before | Expand all | Expand 10 after
4598 value = v8_compile("other.blocked_prop")->Run(); 4598 value = v8_compile("other.blocked_prop")->Run();
4599 CHECK(value->IsUndefined()); 4599 CHECK(value->IsUndefined());
4600 4600
4601 value = v8_compile("propertyIsEnumerable.call(other, 'blocked_prop')")->Run(); 4601 value = v8_compile("propertyIsEnumerable.call(other, 'blocked_prop')")->Run();
4602 CHECK(value->IsFalse()); 4602 CHECK(value->IsFalse());
4603 4603
4604 // Access accessible property 4604 // Access accessible property
4605 value = v8_compile("other.accessible_prop = 3")->Run(); 4605 value = v8_compile("other.accessible_prop = 3")->Run();
4606 CHECK(value->IsNumber()); 4606 CHECK(value->IsNumber());
4607 CHECK_EQ(3, value->Int32Value()); 4607 CHECK_EQ(3, value->Int32Value());
4608 CHECK_EQ(3, g_echo_value);
4608 4609
4609 value = v8_compile("other.accessible_prop")->Run(); 4610 value = v8_compile("other.accessible_prop")->Run();
4610 CHECK(value->IsNumber()); 4611 CHECK(value->IsNumber());
4611 CHECK_EQ(3, value->Int32Value()); 4612 CHECK_EQ(3, value->Int32Value());
4612 4613
4613 value = 4614 value =
4614 v8_compile("propertyIsEnumerable.call(other, 'accessible_prop')")->Run(); 4615 v8_compile("propertyIsEnumerable.call(other, 'accessible_prop')")->Run();
4615 CHECK(value->IsTrue()); 4616 CHECK(value->IsTrue());
4616 4617
4617 // Enumeration doesn't enumerate accessors from inaccessible objects in 4618 // Enumeration doesn't enumerate accessors from inaccessible objects in
(...skipping 5330 matching lines...) Expand 10 before | Expand all | Expand 10 after
9948 // This compile will get the code from the compilation cache. 9949 // This compile will get the code from the compilation cache.
9949 CompileRun(source); 9950 CompileRun(source);
9950 9951
9951 script = v8::Script::Compile(v8_str("new C1();")); 9952 script = v8::Script::Compile(v8_str("new C1();"));
9952 for (int i = 0; i < 10; i++) { 9953 for (int i = 0; i < 10; i++) {
9953 v8::Handle<v8::Object> c1 = v8::Handle<v8::Object>::Cast(script->Run()); 9954 v8::Handle<v8::Object> c1 = v8::Handle<v8::Object>::Cast(script->Run());
9954 CHECK_EQ(42, c1->Get(v8_str("x"))->Int32Value()); 9955 CHECK_EQ(42, c1->Get(v8_str("x"))->Int32Value());
9955 CHECK_EQ(23, c1->Get(v8_str("y"))->Int32Value()); 9956 CHECK_EQ(23, c1->Get(v8_str("y"))->Int32Value());
9956 } 9957 }
9957 } 9958 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698