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

Side by Side Diff: test/js/browser_tests_bootstrap.js

Issue 12457030: [js-interop] Fix function binding and avoid noSuchMethod when using map notation (Closed) Base URL: https://github.com/dart-lang/js-interop.git@master
Patch Set: Fix for constructors plus cleanup Created 7 years, 8 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
« lib/js.dart ('K') | « test/js/browser_tests.dart ('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) 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 var x = 42; 5 var x = 42;
6 6
7 var _x = 123; 7 var _x = 123;
8 8
9 var myArray = ["value1"]; 9 var myArray = ["value1"];
10 10
11 var foreignDoc = (function(){ 11 var foreignDoc = (function(){
12 var doc = document.implementation.createDocument("", "root", null); 12 var doc = document.implementation.createDocument("", "root", null);
13 var element = doc.createElement('element'); 13 var element = doc.createElement('element');
14 element.setAttribute('id', 'abc'); 14 element.setAttribute('id', 'abc');
15 doc.documentElement.appendChild(element); 15 doc.documentElement.appendChild(element);
16 return doc; 16 return doc;
17 })(); 17 })();
18 18
19 function razzle() { 19 function razzle() {
20 return x; 20 return x;
21 } 21 }
22 22
23 function varArgs() {
24 var args = arguments;
25 var sum = 0;
26 for (var i = 0; i < args.length; ++i) {
27 sum += args[i];
28 }
29 return sum;
30 }
31
23 function Foo(a) { 32 function Foo(a) {
24 this.a = a; 33 this.a = a;
25 } 34 }
26 35
36 Foo.b = 38;
37
27 Foo.prototype.bar = function() { 38 Foo.prototype.bar = function() {
28 return this.a; 39 return this.a;
29 } 40 }
30 41
42 var container = new Object();
43 container.Foo = Foo;
44
31 function isArray(a) { 45 function isArray(a) {
32 return a instanceof Array; 46 return a instanceof Array;
33 } 47 }
34 48
35 function checkMap(m, key, value) { 49 function checkMap(m, key, value) {
36 if (m.hasOwnProperty(key)) 50 if (m.hasOwnProperty(key))
37 return m[key] == value; 51 return m[key] == value;
38 else 52 else
39 return false; 53 return false;
40 } 54 }
(...skipping 28 matching lines...) Expand all
69 83
70 function testJsMap(callback) { 84 function testJsMap(callback) {
71 var result = callback(); 85 var result = callback();
72 return result['value']; 86 return result['value'];
73 } 87 }
74 88
75 function Bar() { 89 function Bar() {
76 return "ret_value"; 90 return "ret_value";
77 } 91 }
78 Bar.foo = "property_value"; 92 Bar.foo = "property_value";
OLDNEW
« lib/js.dart ('K') | « test/js/browser_tests.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698