| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 23 matching lines...) Expand all Loading... |
| 34 #include "frames-inl.h" | 34 #include "frames-inl.h" |
| 35 #include "string-stream.h" | 35 #include "string-stream.h" |
| 36 | 36 |
| 37 using ::v8::ObjectTemplate; | 37 using ::v8::ObjectTemplate; |
| 38 using ::v8::Value; | 38 using ::v8::Value; |
| 39 using ::v8::Context; | 39 using ::v8::Context; |
| 40 using ::v8::Local; | 40 using ::v8::Local; |
| 41 using ::v8::String; | 41 using ::v8::String; |
| 42 using ::v8::Script; | 42 using ::v8::Script; |
| 43 using ::v8::Function; | 43 using ::v8::Function; |
| 44 using ::v8::AccessorInfo; | |
| 45 using ::v8::Extension; | 44 using ::v8::Extension; |
| 46 | 45 |
| 47 static void handle_property(Local<String> name, | 46 static void handle_property(Local<String> name, |
| 48 const v8::PropertyCallbackInfo<v8::Value>& info) { | 47 const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 49 ApiTestFuzzer::Fuzz(); | 48 ApiTestFuzzer::Fuzz(); |
| 50 info.GetReturnValue().Set(v8_num(900)); | 49 info.GetReturnValue().Set(v8_num(900)); |
| 51 } | 50 } |
| 52 | 51 |
| 53 | 52 |
| 54 static void handle_property(const v8::FunctionCallbackInfo<v8::Value>& info) { | 53 static void handle_property(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 LocalContext env; | 520 LocalContext env; |
| 522 v8::HandleScope scope(env->GetIsolate()); | 521 v8::HandleScope scope(env->GetIsolate()); |
| 523 | 522 |
| 524 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); | 523 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
| 525 obj->SetNamedPropertyHandler( | 524 obj->SetNamedPropertyHandler( |
| 526 JSONStringifyGetter, NULL, NULL, NULL, JSONStringifyEnumerator); | 525 JSONStringifyGetter, NULL, NULL, NULL, JSONStringifyEnumerator); |
| 527 env->Global()->Set(v8_str("obj"), obj->NewInstance()); | 526 env->Global()->Set(v8_str("obj"), obj->NewInstance()); |
| 528 v8::Handle<v8::String> expected = v8_str("{\"regress\":\"crbug-161028\"}"); | 527 v8::Handle<v8::String> expected = v8_str("{\"regress\":\"crbug-161028\"}"); |
| 529 CHECK(CompileRun("JSON.stringify(obj)")->Equals(expected)); | 528 CHECK(CompileRun("JSON.stringify(obj)")->Equals(expected)); |
| 530 } | 529 } |
| OLD | NEW |