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

Side by Side Diff: tests/compiler/dart2js/serialization/equivalence_test.dart

Issue 2065413002: Serialize and process patch metadata (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.serialization_test; 5 library dart2js.serialization_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import '../memory_compiler.dart'; 8 import '../memory_compiler.dart';
9 import 'package:async_helper/async_helper.dart'; 9 import 'package:async_helper/async_helper.dart';
10 import 'package:compiler/src/commandline_options.dart'; 10 import 'package:compiler/src/commandline_options.dart';
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 check(element1, element2, 'isAbstract', 280 check(element1, element2, 'isAbstract',
281 element1.isAbstract, element2.isAbstract); 281 element1.isAbstract, element2.isAbstract);
282 check(element1, element2, 'isStatic', 282 check(element1, element2, 'isStatic',
283 element1.isStatic, element2.isStatic); 283 element1.isStatic, element2.isStatic);
284 check(element1, element2, 'isTopLevel', 284 check(element1, element2, 'isTopLevel',
285 element1.isTopLevel, element2.isTopLevel); 285 element1.isTopLevel, element2.isTopLevel);
286 check(element1, element2, 'isClassMember', 286 check(element1, element2, 'isClassMember',
287 element1.isClassMember, element2.isClassMember); 287 element1.isClassMember, element2.isClassMember);
288 check(element1, element2, 'isInstanceMember', 288 check(element1, element2, 'isInstanceMember',
289 element1.isInstanceMember, element2.isInstanceMember); 289 element1.isInstanceMember, element2.isInstanceMember);
290 List<MetadataAnnotation> metadata1 = <MetadataAnnotation>[];
291 metadata1.addAll(element1.metadata);
292 if (element1.isPatched) {
293 metadata1.addAll(element1.implementation.metadata);
294 }
295 List<MetadataAnnotation> metadata2 = <MetadataAnnotation>[];
296 metadata2.addAll(element2.metadata);
297 if (element2.isPatched) {
298 metadata2.addAll(element2.implementation.metadata);
299 }
290 checkListEquivalence(element1, element2, 'metadata', 300 checkListEquivalence(element1, element2, 'metadata',
291 element1.metadata, element2.metadata, checkMetadata); 301 metadata1, metadata2, checkMetadata);
292 } 302 }
293 303
294 @override 304 @override
295 void visitElement(Element e, Element arg) { 305 void visitElement(Element e, Element arg) {
296 throw new UnsupportedError("Unsupported element $e"); 306 throw new UnsupportedError("Unsupported element $e");
297 } 307 }
298 308
299 @override 309 @override
300 void visitLibraryElement(LibraryElement element1, LibraryElement element2) { 310 void visitLibraryElement(LibraryElement element1, LibraryElement element2) {
301 checkElementIdentities(null, null, null, element1, element2); 311 checkElementIdentities(null, null, null, element1, element2);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 String message = 397 String message =
388 'Missing member for $member1 in\n ${members2.join('\n ')}'; 398 'Missing member for $member1 in\n ${members2.join('\n ')}';
389 if (member1.isAbstractField) { 399 if (member1.isAbstractField) {
390 // TODO(johnniwinther): Ensure abstract fields are handled correctly. 400 // TODO(johnniwinther): Ensure abstract fields are handled correctly.
391 //print(message); 401 //print(message);
392 continue; 402 continue;
393 } else { 403 } else {
394 throw message; 404 throw message;
395 } 405 }
396 } 406 }
397 currentCheck = new Check(currentCheck, element1, element1, 407 currentCheck = new Check(currentCheck, element1, element2,
398 'member:$name', member1, member2); 408 'member:$name', member1, member2);
399 visit(member1, member2); 409 visit(member1, member2);
400 currentCheck = currentCheck.parent; 410 currentCheck = currentCheck.parent;
401 } 411 }
402 } 412 }
403 413
404 @override 414 @override
405 void visitClassElement(ClassElement element1, ClassElement element2) { 415 void visitClassElement(ClassElement element1, ClassElement element2) {
406 checkElementIdentities(null, null, null, element1, element2); 416 checkElementIdentities(null, null, null, element1, element2);
407 check(element1, element2, 'name', 417 check(element1, element2, 'name',
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 void visitPrefixElement(PrefixElement element1, PrefixElement element2) { 796 void visitPrefixElement(PrefixElement element1, PrefixElement element2) {
787 check( 797 check(
788 element1, element2, 'isDeferred', 798 element1, element2, 'isDeferred',
789 element1.isDeferred, element2.isDeferred); 799 element1.isDeferred, element2.isDeferred);
790 checkElementIdentities( 800 checkElementIdentities(
791 element1, element2, 'importedLibrary', 801 element1, element2, 'importedLibrary',
792 element1.deferredImport, element2.deferredImport); 802 element1.deferredImport, element2.deferredImport);
793 // TODO(johnniwinther): Check members. 803 // TODO(johnniwinther): Check members.
794 } 804 }
795 } 805 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/serialization/element_serialization.dart ('k') | tests/compiler/dart2js/serialization/model_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698