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

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

Issue 1967073002: Check closure data for serialization (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 7 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 void visit(Element element1, Element element2) { 239 void visit(Element element1, Element element2) {
240 if (element1 == null && element2 == null) return; 240 if (element1 == null && element2 == null) return;
241 element1 = element1.declaration; 241 element1 = element1.declaration;
242 element2 = element2.declaration; 242 element2 = element2.declaration;
243 if (element1 == element2) return; 243 if (element1 == element2) return;
244 check(element1, element2, 'kind', element1.kind, element2.kind); 244 check(element1, element2, 'kind', element1.kind, element2.kind);
245 element1.accept(this, element2); 245 element1.accept(this, element2);
246 check(element1, element2, 'isSynthesized', 246 check(element1, element2, 'isSynthesized',
247 element1.isSynthesized, element2.isSynthesized); 247 element1.isSynthesized, element2.isSynthesized);
248 check(element1, element2, 'isLocal',
249 element1.isLocal, element2.isLocal);
250 check(element1, element2, 'isFinal',
251 element1.isFinal, element2.isFinal);
252 check(element1, element2, 'isConst',
253 element1.isConst, element2.isConst);
248 } 254 }
249 255
250 @override 256 @override
251 void visitElement(Element e, Element arg) { 257 void visitElement(Element e, Element arg) {
252 throw new UnsupportedError("Unsupported element $e"); 258 throw new UnsupportedError("Unsupported element $e");
253 } 259 }
254 260
255 @override 261 @override
256 void visitLibraryElement(LibraryElement element1, LibraryElement element2) { 262 void visitLibraryElement(LibraryElement element1, LibraryElement element2) {
257 checkElementIdentities(null, null, null, element1, element2); 263 checkElementIdentities(null, null, null, element1, element2);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 @override 437 @override
432 void visitFieldElement(FieldElement element1, FieldElement element2) { 438 void visitFieldElement(FieldElement element1, FieldElement element2) {
433 checkElementIdentities(null, null, null, element1, element2); 439 checkElementIdentities(null, null, null, element1, element2);
434 check(element1, element2, 'name', 440 check(element1, element2, 'name',
435 element1.name, element2.name); 441 element1.name, element2.name);
436 check(element1, element2, 'sourcePosition', 442 check(element1, element2, 'sourcePosition',
437 element1.sourcePosition, element2.sourcePosition); 443 element1.sourcePosition, element2.sourcePosition);
438 checkTypes( 444 checkTypes(
439 element1, element2, 'type', 445 element1, element2, 'type',
440 element1.type, element2.type); 446 element1.type, element2.type);
441 check(element1, element2, 'isConst',
442 element1.isConst, element2.isConst);
443 check(element1, element2, 'isFinal',
444 element1.isFinal, element2.isFinal);
445 checkConstants( 447 checkConstants(
446 element1, element2, 'constant', 448 element1, element2, 'constant',
447 element1.constant, element2.constant); 449 element1.constant, element2.constant);
448 check(element1, element2, 'isTopLevel', 450 check(element1, element2, 'isTopLevel',
449 element1.isTopLevel, element2.isTopLevel); 451 element1.isTopLevel, element2.isTopLevel);
450 check(element1, element2, 'isStatic', 452 check(element1, element2, 'isStatic',
451 element1.isStatic, element2.isStatic); 453 element1.isStatic, element2.isStatic);
452 check(element1, element2, 'isInstanceMember', 454 check(element1, element2, 'isInstanceMember',
453 element1.isInstanceMember, element2.isInstanceMember); 455 element1.isInstanceMember, element2.isInstanceMember);
454 456
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 element1.name, element2.name); 548 element1.name, element2.name);
547 check(element1, element2, 'sourcePosition', 549 check(element1, element2, 'sourcePosition',
548 element1.sourcePosition, element2.sourcePosition); 550 element1.sourcePosition, element2.sourcePosition);
549 checkListEquivalence( 551 checkListEquivalence(
550 element1, element2, 'parameters', 552 element1, element2, 'parameters',
551 element1.parameters, element2.parameters, 553 element1.parameters, element2.parameters,
552 checkElementProperties); 554 checkElementProperties);
553 checkTypes( 555 checkTypes(
554 element1, element2, 'type', 556 element1, element2, 'type',
555 element1.type, element2.type); 557 element1.type, element2.type);
556 check(element1, element2, 'isConst',
557 element1.isConst, element2.isConst);
558 check(element1, element2, 'isExternal', 558 check(element1, element2, 'isExternal',
559 element1.isExternal, element2.isExternal); 559 element1.isExternal, element2.isExternal);
560 if (element1.isConst && !element1.isExternal) { 560 if (element1.isConst && !element1.isExternal) {
561 constantConstructorEquivalence( 561 constantConstructorEquivalence(
562 element1.constantConstructor, 562 element1.constantConstructor,
563 element2.constantConstructor); 563 element2.constantConstructor);
564 } 564 }
565 check(element1, element2, 'isRedirectingGenerative', 565 check(element1, element2, 'isRedirectingGenerative',
566 element1.isRedirectingGenerative, element2.isRedirectingGenerative); 566 element1.isRedirectingGenerative, element2.isRedirectingGenerative);
567 check(element1, element2, 'isRedirectingFactory', 567 check(element1, element2, 'isRedirectingFactory',
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 element1.sourcePosition, element2.sourcePosition); 639 element1.sourcePosition, element2.sourcePosition);
640 checkTypes( 640 checkTypes(
641 element1, element2, 'type', 641 element1, element2, 'type',
642 element1.type, element2.type); 642 element1.type, element2.type);
643 check( 643 check(
644 element1, element2, 'isOptional', 644 element1, element2, 'isOptional',
645 element1.isOptional, element2.isOptional); 645 element1.isOptional, element2.isOptional);
646 check( 646 check(
647 element1, element2, 'isNamed', 647 element1, element2, 'isNamed',
648 element1.isNamed, element2.isNamed); 648 element1.isNamed, element2.isNamed);
649 check(
650 element1, element2, 'isFinal',
651 element1.isFinal, element2.isFinal);
652 check(element1, element2, 'name', element1.name, element2.name); 649 check(element1, element2, 'name', element1.name, element2.name);
653 if (element1.isOptional) { 650 if (element1.isOptional) {
654 checkConstants( 651 checkConstants(
655 element1, element2, 'constant', 652 element1, element2, 'constant',
656 element1.constant, element2.constant); 653 element1.constant, element2.constant);
657 } 654 }
658 checkElementIdentities( 655 checkElementIdentities(
659 element1, element2, 'compilationUnit', 656 element1, element2, 'compilationUnit',
660 element1.compilationUnit, element2.compilationUnit); 657 element1.compilationUnit, element2.compilationUnit);
661 } 658 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 void visitPrefixElement(PrefixElement element1, PrefixElement element2) { 692 void visitPrefixElement(PrefixElement element1, PrefixElement element2) {
696 check( 693 check(
697 element1, element2, 'isDeferred', 694 element1, element2, 'isDeferred',
698 element1.isDeferred, element2.isDeferred); 695 element1.isDeferred, element2.isDeferred);
699 checkElementIdentities( 696 checkElementIdentities(
700 element1, element2, 'importedLibrary', 697 element1, element2, 'importedLibrary',
701 element1.deferredImport, element2.deferredImport); 698 element1.deferredImport, element2.deferredImport);
702 // TODO(johnniwinther): Check members. 699 // TODO(johnniwinther): Check members.
703 } 700 }
704 } 701 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/serialization/compilation_test.dart ('k') | tests/compiler/dart2js/serialization/helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698