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

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

Issue 313653002: Fix leaky tests added by r21649. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 uint16_t* two_byte_name = AsciiToTwoByteString("obj1.oXj2.foo1"); 2512 uint16_t* two_byte_name = AsciiToTwoByteString("obj1.oXj2.foo1");
2513 // Make it really non-ASCII (replace the Xs with a non-ASCII character). 2513 // Make it really non-ASCII (replace the Xs with a non-ASCII character).
2514 two_byte_source[14] = two_byte_source[78] = two_byte_name[6] = 0x010d; 2514 two_byte_source[14] = two_byte_source[78] = two_byte_name[6] = 0x010d;
2515 v8::Local<v8::String> source = 2515 v8::Local<v8::String> source =
2516 v8::String::NewFromTwoByte(isolate, two_byte_source); 2516 v8::String::NewFromTwoByte(isolate, two_byte_source);
2517 v8::Local<v8::Value> result = CompileRun(source); 2517 v8::Local<v8::Value> result = CompileRun(source);
2518 CHECK(result->IsString()); 2518 CHECK(result->IsString());
2519 v8::Local<v8::String> expected_name = 2519 v8::Local<v8::String> expected_name =
2520 v8::String::NewFromTwoByte(isolate, two_byte_name); 2520 v8::String::NewFromTwoByte(isolate, two_byte_name);
2521 CHECK(result->Equals(expected_name)); 2521 CHECK(result->Equals(expected_name));
2522 i::DeleteArray(two_byte_source);
2523 i::DeleteArray(two_byte_name);
2522 } 2524 }
2523 2525
2524 2526
2525 TEST(FuncNameInferrerEscaped) { 2527 TEST(FuncNameInferrerEscaped) {
2526 // The same as FuncNameInferrerTwoByte, except that we express the two-byte 2528 // The same as FuncNameInferrerTwoByte, except that we express the two-byte
2527 // character as a unicode escape. 2529 // character as a unicode escape.
2528 i::FLAG_allow_natives_syntax = true; 2530 i::FLAG_allow_natives_syntax = true;
2529 v8::Isolate* isolate = CcTest::isolate(); 2531 v8::Isolate* isolate = CcTest::isolate();
2530 v8::HandleScope scope(isolate); 2532 v8::HandleScope scope(isolate);
2531 LocalContext env; 2533 LocalContext env;
2532 uint16_t* two_byte_source = AsciiToTwoByteString( 2534 uint16_t* two_byte_source = AsciiToTwoByteString(
2533 "var obj1 = { o\\u010dj2 : { foo1: function() {} } }; " 2535 "var obj1 = { o\\u010dj2 : { foo1: function() {} } }; "
2534 "%FunctionGetInferredName(obj1.o\\u010dj2.foo1)"); 2536 "%FunctionGetInferredName(obj1.o\\u010dj2.foo1)");
2535 uint16_t* two_byte_name = AsciiToTwoByteString("obj1.oXj2.foo1"); 2537 uint16_t* two_byte_name = AsciiToTwoByteString("obj1.oXj2.foo1");
2536 // Fix to correspond to the non-ASCII name in two_byte_source. 2538 // Fix to correspond to the non-ASCII name in two_byte_source.
2537 two_byte_name[6] = 0x010d; 2539 two_byte_name[6] = 0x010d;
2538 v8::Local<v8::String> source = 2540 v8::Local<v8::String> source =
2539 v8::String::NewFromTwoByte(isolate, two_byte_source); 2541 v8::String::NewFromTwoByte(isolate, two_byte_source);
2540 v8::Local<v8::Value> result = CompileRun(source); 2542 v8::Local<v8::Value> result = CompileRun(source);
2541 CHECK(result->IsString()); 2543 CHECK(result->IsString());
2542 v8::Local<v8::String> expected_name = 2544 v8::Local<v8::String> expected_name =
2543 v8::String::NewFromTwoByte(isolate, two_byte_name); 2545 v8::String::NewFromTwoByte(isolate, two_byte_name);
2544 CHECK(result->Equals(expected_name)); 2546 CHECK(result->Equals(expected_name));
2547 i::DeleteArray(two_byte_source);
2548 i::DeleteArray(two_byte_name);
2545 } 2549 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698