OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import 'dart:io'; | 5 import 'dart:io'; |
6 | 6 |
7 // TODO(jmesserly): should be importing a compiler mirrors package. | 7 // TODO(jmesserly): should be importing a compiler mirrors package. |
8 // This is currently generated by the shell script. | 8 // This is currently generated by the shell script. |
9 import 'compile_mirrors.dart'; | 9 import 'compile_mirrors.dart'; |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 The information is used to create "$OUTPUT_NAME". | 33 The information is used to create "$OUTPUT_NAME". |
34 '''); | 34 '''); |
35 | 35 |
36 var sdk = Platform.environment['DART_SDK']; | 36 var sdk = Platform.environment['DART_SDK']; |
37 if (sdk == null) { | 37 if (sdk == null) { |
38 print('DART_SDK path must be set. Use gen_html_setters.sh.'); | 38 print('DART_SDK path must be set. Use gen_html_setters.sh.'); |
39 exit(1); | 39 exit(1); |
40 } | 40 } |
41 | 41 |
42 var htmlPath = new Path('dart:html'); | 42 var htmlPath = new Path('dart:html'); |
43 var audioPath = new Path('dart:web_audio'); | |
44 var svgPath = new Path('dart:svg'); | 43 var svgPath = new Path('dart:svg'); |
45 var libPath = new Path(sdk).append('/'); | 44 var libPath = new Path(sdk).append('/'); |
46 var pkgPath = new Path(sdk).append('pkg/'); | 45 var pkgPath = new Path(sdk).append('pkg/'); |
47 | 46 |
48 var mirrors = new Compilation.library( | 47 var mirrors = new Compilation.library( |
49 [htmlPath, audioPath, svgPath], libPath, pkgPath).mirrors; | 48 [htmlPath, svgPath], libPath, pkgPath).mirrors; |
50 var html = mirrors.libraries['html']; | 49 var html = mirrors.libraries['html']; |
51 | 50 |
52 | 51 |
53 var extendsCode = new StringBuffer(); | 52 var extendsCode = new StringBuffer(); |
54 extendsCode.add('var htmlElementExtends = const {\n'); | 53 extendsCode.add('var htmlElementExtends = const {\n'); |
55 | 54 |
56 var code = new StringBuffer(); | 55 var code = new StringBuffer(); |
57 code.add('// This file is autogenerated by $MY_NAME. Do not edit.\n'); | 56 code.add('// This file is autogenerated by $MY_NAME. Do not edit.\n'); |
58 code.add('library html5_setters;\n'); | 57 code.add('library html5_setters;\n'); |
59 | 58 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 void _addElement(ClassMirror cls, Set elemSet) { | 113 void _addElement(ClassMirror cls, Set elemSet) { |
115 while (cls != null) { | 114 while (cls != null) { |
116 if (!cls.isOriginalDeclaration) cls = cls.originalDeclaration; | 115 if (!cls.isOriginalDeclaration) cls = cls.originalDeclaration; |
117 if (!cls.displayName.endsWith('Element') || elemSet.contains(cls)) { | 116 if (!cls.displayName.endsWith('Element') || elemSet.contains(cls)) { |
118 break; | 117 break; |
119 } | 118 } |
120 elemSet.add(cls); | 119 elemSet.add(cls); |
121 cls = cls.superclass; | 120 cls = cls.superclass; |
122 } | 121 } |
123 } | 122 } |
OLD | NEW |