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

Side by Side Diff: tool/input_sdk/private/native_helper.dart

Issue 1152333009: Delete dart2js specific private library code (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Rebase Created 5 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
« no previous file with comments | « tool/input_sdk/private/mirror_helper.dart ('k') | tool/sdk_expected_errors.txt » ('j') | 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 part of _js_helper; 5 part of _js_helper;
6 6
7 7
8 // TODO(ngeoffray): stop using this method once our optimizers can
9 // change str1.contains(str2) into str1.indexOf(str2) != -1.
10 bool contains(String userAgent, String name) {
11 return JS('int', '#.indexOf(#)', userAgent, name) != -1;
12 }
13
14 int arrayLength(List array) {
15 return JS('int', '#.length', array);
16 }
17
18 arrayGet(List array, int index) {
19 return JS('var', '#[#]', array, index);
20 }
21
22 void arraySet(List array, int index, var value) {
23 JS('var', '#[#] = #', array, index, value);
24 }
25
26 propertyGet(var object, String property) {
27 return JS('var', '#[#]', object, property);
28 }
29
30 bool callHasOwnProperty(var function, var object, String property) {
31 return JS('bool', '#.call(#, #)', function, object, property);
32 }
33
34 void propertySet(var object, String property, var value) {
35 JS('var', '#[#] = #', object, property, value);
36 }
37
38 getPropertyFromPrototype(var object, String name) {
39 return JS('var', 'Object.getPrototypeOf(#)[#]', object, name);
40 }
41
42 /** 8 /**
43 * Sets a JavaScript property on an object. 9 * Sets a JavaScript property on an object.
44 */ 10 */
45 void defineProperty(var obj, String property, var value) { 11 void defineProperty(var obj, String property, var value) {
46 JS('void', 12 JS('void',
47 'Object.defineProperty(#, #, ' 13 'Object.defineProperty(#, #, '
48 '{value: #, enumerable: false, writable: true, configurable: true})', 14 '{value: #, enumerable: false, writable: true, configurable: true})',
49 obj, 15 obj,
50 property, 16 property,
51 value); 17 value);
52 } 18 }
OLDNEW
« no previous file with comments | « tool/input_sdk/private/mirror_helper.dart ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698