| OLD | NEW |
| 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 3852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3863 | 3863 |
| 3864 ExpectBoolean("Object.isExtensible(undetectable)", true); | 3864 ExpectBoolean("Object.isExtensible(undetectable)", true); |
| 3865 | 3865 |
| 3866 source = v8_str("Object.preventExtensions(undetectable);"); | 3866 source = v8_str("Object.preventExtensions(undetectable);"); |
| 3867 script = Script::Compile(source); | 3867 script = Script::Compile(source); |
| 3868 script->Run(); | 3868 script->Run(); |
| 3869 ExpectBoolean("Object.isExtensible(undetectable)", false); | 3869 ExpectBoolean("Object.isExtensible(undetectable)", false); |
| 3870 | 3870 |
| 3871 source = v8_str("undetectable.y = 2000;"); | 3871 source = v8_str("undetectable.y = 2000;"); |
| 3872 script = Script::Compile(source); | 3872 script = Script::Compile(source); |
| 3873 v8::TryCatch try_catch; | |
| 3874 Local<Value> result = script->Run(); | 3873 Local<Value> result = script->Run(); |
| 3875 CHECK(result.IsEmpty()); | 3874 ExpectBoolean("undetectable.y == undefined", true); |
| 3876 CHECK(try_catch.HasCaught()); | |
| 3877 } | 3875 } |
| 3878 | 3876 |
| 3879 | 3877 |
| 3880 | 3878 |
| 3881 THREADED_TEST(UndetectableString) { | 3879 THREADED_TEST(UndetectableString) { |
| 3882 v8::HandleScope scope; | 3880 v8::HandleScope scope; |
| 3883 LocalContext env; | 3881 LocalContext env; |
| 3884 | 3882 |
| 3885 Local<String> obj = String::NewUndetectable("foo"); | 3883 Local<String> obj = String::NewUndetectable("foo"); |
| 3886 env->Global()->Set(v8_str("undetectable"), obj); | 3884 env->Global()->Set(v8_str("undetectable"), obj); |
| (...skipping 9588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13475 v8::Handle<v8::Function> define_property = | 13473 v8::Handle<v8::Function> define_property = |
| 13476 CompileRun("(function() {" | 13474 CompileRun("(function() {" |
| 13477 " Object.defineProperty(" | 13475 " Object.defineProperty(" |
| 13478 " this," | 13476 " this," |
| 13479 " 1," | 13477 " 1," |
| 13480 " { configurable: true, enumerable: true, value: 3 });" | 13478 " { configurable: true, enumerable: true, value: 3 });" |
| 13481 "})").As<Function>(); | 13479 "})").As<Function>(); |
| 13482 context->DetachGlobal(); | 13480 context->DetachGlobal(); |
| 13483 define_property->Call(proxy, 0, NULL); | 13481 define_property->Call(proxy, 0, NULL); |
| 13484 } | 13482 } |
| OLD | NEW |