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

Side by Side Diff: test_sources/non_transformed/web/test.js

Issue 580283004: Add JsInitializerGenerator (Closed) Base URL: https://github.com/dart-lang/js-interop.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « test_sources/non_transformed/web/generated_code_test.html ('k') | 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 (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 var foo = new JsThing('made in JS'); 5 var foo = new JsThing('made in JS');
6 var aString = 'hello'; 6 var aString = 'hello';
7 var aNum = 123; 7 var aNum = 123;
8 var aBool = true; 8 var aBool = true;
9 var a = null; 9 var a = null;
10 10
(...skipping 25 matching lines...) Expand all
36 return hasName.name; 36 return hasName.name;
37 } 37 }
38 38
39 function roundTrip(e) { 39 function roundTrip(e) {
40 return e; 40 return e;
41 } 41 }
42 42
43 function isNull(value) { 43 function isNull(value) {
44 return value === null; 44 return value === null;
45 } 45 }
46
47 // hand-generated export code derived from test.dart
48
49 window.dart = window.dart || {};
50
51 window.dart.Object = function DartObject() {
52 throw "not allowed";
53 };
54
55 window.dart.Object._wrapDartObject = function(dartObject) {
56 var o = Object.create(window.dart.Object.prototype);
57 o.__dart_object__ = dartObject;
58 return o;
59 };
60
61 _export_dart_test(dart);
62
63 function _export_dart_test(parent) {
64 var lib = parent.test = {};
65 _export_dart_test_library(lib);
66 }
67
68 function _export_dart_test_library(parent) {
69 var lib = parent.library = {};
70 _export_test_library_ExportMe(lib);
71 }
72
73 function _export_test_library_ExportMe(parent) {
74 var constructor = parent.ExportMe = function ExportMeJs() {
75 this.__dart_object__ = constructor._new();
76 };
77 constructor.prototype = Object.create(dart.Object.prototype);
78 constructor.prototype.constructor = constructor;
79 constructor._wrapDartObject = function(dartObject) {
80 var o = Object.create(constructor.prototype);
81 o.__dart_object__ = dartObject;
82 return o;
83 };
84
85 // named constructor
86 constructor.named = function ExportMeJs(name) {
87 this.__dart_object__ = constructor._new_named(name);
88 };
89 constructor.named.prototype = constructor.prototype;
90 }
OLDNEW
« no previous file with comments | « test_sources/non_transformed/web/generated_code_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698