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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 obj->Set(String::NewFromUtf8(v8_isolate, "foo"), | 268 obj->Set(String::NewFromUtf8(v8_isolate, "foo"), |
269 Number::New(v8_isolate, 7)); | 269 Number::New(v8_isolate, 7)); |
270 obj->Set(1, Number::New(v8_isolate, 2)); | 270 obj->Set(1, Number::New(v8_isolate, 2)); |
271 // ForceSet should work just as well as Set | 271 // ForceSet should work just as well as Set |
272 obj->ForceSet(String::NewFromUtf8(v8_isolate, "foo"), | 272 obj->ForceSet(String::NewFromUtf8(v8_isolate, "foo"), |
273 Number::New(v8_isolate, 3)); | 273 Number::New(v8_isolate, 3)); |
274 obj->ForceSet(Number::New(v8_isolate, 1), Number::New(v8_isolate, 4)); | 274 obj->ForceSet(Number::New(v8_isolate, 1), Number::New(v8_isolate, 4)); |
275 // Setting an indexed element via the property setting method | 275 // Setting an indexed element via the property setting method |
276 obj->Set(Number::New(v8_isolate, 1), Number::New(v8_isolate, 5)); | 276 obj->Set(Number::New(v8_isolate, 1), Number::New(v8_isolate, 5)); |
277 // Setting with a non-String, non-uint32 key | 277 // Setting with a non-String, non-uint32 key |
278 obj->Set(Number::New(v8_isolate, 1.1), | 278 obj->ForceSet(Number::New(v8_isolate, 1.1), Number::New(v8_isolate, 6), |
279 Number::New(v8_isolate, 6), DontDelete); | 279 DontDelete); |
280 obj->Delete(String::NewFromUtf8(v8_isolate, "foo")); | 280 obj->Delete(String::NewFromUtf8(v8_isolate, "foo")); |
281 obj->Delete(1); | 281 obj->Delete(1); |
282 obj->ForceDelete(Number::New(v8_isolate, 1.1)); | 282 obj->ForceDelete(Number::New(v8_isolate, 1.1)); |
283 | 283 |
284 // Force delivery | 284 // Force delivery |
285 // TODO(adamk): Should the above set methods trigger delivery themselves? | 285 // TODO(adamk): Should the above set methods trigger delivery themselves? |
286 CompileRun("void 0"); | 286 CompileRun("void 0"); |
287 CHECK_EQ(9, CompileRun("records.length")->Int32Value()); | 287 CHECK_EQ(9, CompileRun("records.length")->Int32Value()); |
288 const RecordExpectation expected_records[] = { | 288 const RecordExpectation expected_records[] = { |
289 { obj, "add", "foo", Handle<Value>() }, | 289 { obj, "add", "foo", Handle<Value>() }, |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 notifier); | 702 notifier); |
703 CompileRun("var obj2 = {};" | 703 CompileRun("var obj2 = {};" |
704 "var notifier2 = Object.getNotifier(obj2);" | 704 "var notifier2 = Object.getNotifier(obj2);" |
705 "notifier2.performChange.call(" | 705 "notifier2.performChange.call(" |
706 "notifier, 'foo', function(){})"); | 706 "notifier, 'foo', function(){})"); |
707 } | 707 } |
708 | 708 |
709 v8::V8::ContextDisposedNotification(); | 709 v8::V8::ContextDisposedNotification(); |
710 CheckSurvivingGlobalObjectsCount(1); | 710 CheckSurvivingGlobalObjectsCount(1); |
711 } | 711 } |
OLD | NEW |