| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 "var pre = 'Object: pre'; var on = 'Object: on';"))->Run(); | 1020 "var pre = 'Object: pre'; var on = 'Object: on';"))->Run(); |
| 1021 v8::Handle<Value> result_pre = Script::Compile(v8_str("pre"))->Run(); | 1021 v8::Handle<Value> result_pre = Script::Compile(v8_str("pre"))->Run(); |
| 1022 CHECK_EQ(v8_str("PrePropertyHandler: pre"), result_pre); | 1022 CHECK_EQ(v8_str("PrePropertyHandler: pre"), result_pre); |
| 1023 v8::Handle<Value> result_on = Script::Compile(v8_str("on"))->Run(); | 1023 v8::Handle<Value> result_on = Script::Compile(v8_str("on"))->Run(); |
| 1024 CHECK_EQ(v8_str("Object: on"), result_on); | 1024 CHECK_EQ(v8_str("Object: on"), result_on); |
| 1025 v8::Handle<Value> result_post = Script::Compile(v8_str("post"))->Run(); | 1025 v8::Handle<Value> result_post = Script::Compile(v8_str("post"))->Run(); |
| 1026 CHECK(result_post.IsEmpty()); | 1026 CHECK(result_post.IsEmpty()); |
| 1027 } | 1027 } |
| 1028 | 1028 |
| 1029 | 1029 |
| 1030 THREADED_TEST(UndefinedIsNotEnumerable) { |
| 1031 v8::HandleScope scope; |
| 1032 LocalContext env; |
| 1033 v8::Handle<Value> result = Script::Compile(v8_str( |
| 1034 "this.propertyIsEnumerable(undefined)"))->Run(); |
| 1035 CHECK(result->IsFalse()); |
| 1036 } |
| 1037 |
| 1038 |
| 1030 v8::Handle<Script> call_recursively_script; | 1039 v8::Handle<Script> call_recursively_script; |
| 1031 static const int kTargetRecursionDepth = 300; // near maximum | 1040 static const int kTargetRecursionDepth = 300; // near maximum |
| 1032 | 1041 |
| 1033 | 1042 |
| 1034 static v8::Handle<Value> CallScriptRecursivelyCall(const v8::Arguments& args) { | 1043 static v8::Handle<Value> CallScriptRecursivelyCall(const v8::Arguments& args) { |
| 1035 ApiTestFuzzer::Fuzz(); | 1044 ApiTestFuzzer::Fuzz(); |
| 1036 int depth = args.This()->Get(v8_str("depth"))->Int32Value(); | 1045 int depth = args.This()->Get(v8_str("depth"))->Int32Value(); |
| 1037 if (depth == kTargetRecursionDepth) return v8::Undefined(); | 1046 if (depth == kTargetRecursionDepth) return v8::Undefined(); |
| 1038 args.This()->Set(v8_str("depth"), v8::Integer::New(depth + 1)); | 1047 args.This()->Set(v8_str("depth"), v8::Integer::New(depth + 1)); |
| 1039 return call_recursively_script->Run(); | 1048 return call_recursively_script->Run(); |
| (...skipping 4158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5198 LocalContext context; | 5207 LocalContext context; |
| 5199 Local<ObjectTemplate> templ = ObjectTemplate::New(); | 5208 Local<ObjectTemplate> templ = ObjectTemplate::New(); |
| 5200 templ->SetAccessCheckCallbacks(NamedSetAccessBlocker, | 5209 templ->SetAccessCheckCallbacks(NamedSetAccessBlocker, |
| 5201 IndexedSetAccessBlocker); | 5210 IndexedSetAccessBlocker); |
| 5202 templ->Set(v8_str("x"), v8::True()); | 5211 templ->Set(v8_str("x"), v8::True()); |
| 5203 Local<v8::Object> instance = templ->NewInstance(); | 5212 Local<v8::Object> instance = templ->NewInstance(); |
| 5204 context->Global()->Set(v8_str("obj"), instance); | 5213 context->Global()->Set(v8_str("obj"), instance); |
| 5205 Local<Value> value = CompileRun("obj.x"); | 5214 Local<Value> value = CompileRun("obj.x"); |
| 5206 CHECK(value->BooleanValue()); | 5215 CHECK(value->BooleanValue()); |
| 5207 } | 5216 } |
| OLD | NEW |