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

Side by Side Diff: lib/runtime/dart_runtime.js

Issue 1111803005: fix #159, static renames for caller/arguments (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « no previous file | lib/src/codegen/js_codegen.dart » ('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) 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 var dart, _js_helper; 5 var dart, _js_helper, _js_primitives;
6 (function (dart) { 6 (function (dart) {
7 'use strict'; 7 'use strict';
8 8
9 let defineProperty = Object.defineProperty; 9 let defineProperty = Object.defineProperty;
10 let getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 10 let getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
11 let getOwnPropertyNames = Object.getOwnPropertyNames; 11 let getOwnPropertyNames = Object.getOwnPropertyNames;
12 let getOwnPropertySymbols = Object.getOwnPropertySymbols; 12 let getOwnPropertySymbols = Object.getOwnPropertySymbols;
13 13
14 function getOwnNamesAndSymbols(obj) { 14 function getOwnNamesAndSymbols(obj) {
15 return getOwnPropertyNames(obj).concat(getOwnPropertySymbols(obj)); 15 return getOwnPropertyNames(obj).concat(getOwnPropertySymbols(obj));
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 753
754 /** 754 /**
755 * Given a class and an initializer method name, creates a constructor 755 * Given a class and an initializer method name, creates a constructor
756 * function with the same name. For example `new SomeClass.name(args)`. 756 * function with the same name. For example `new SomeClass.name(args)`.
757 */ 757 */
758 function defineNamedConstructor(clazz, name) { 758 function defineNamedConstructor(clazz, name) {
759 let proto = clazz.prototype; 759 let proto = clazz.prototype;
760 let initMethod = proto[name]; 760 let initMethod = proto[name];
761 let ctor = function() { return initMethod.apply(this, arguments); } 761 let ctor = function() { return initMethod.apply(this, arguments); }
762 ctor.prototype = proto; 762 ctor.prototype = proto;
763 clazz[name] = ctor; 763 defineProperty(clazz, name, { value: ctor, configurable: true });
Jacob 2015/04/29 21:53:19 everything looks fine but not clear why this needs
Jennifer Messerly 2015/04/29 23:07:33 good call, I'll add a comment :)
764 } 764 }
765 dart.defineNamedConstructor = defineNamedConstructor; 765 dart.defineNamedConstructor = defineNamedConstructor;
766 766
767 function stackTrace(exception) { 767 function stackTrace(exception) {
768 throw new core.UnimplementedError(); 768 throw new core.UnimplementedError();
769 } 769 }
770 dart.stackTrace = stackTrace; 770 dart.stackTrace = stackTrace;
771 771
772 /** The Symbol for storing type arguments on a specialized generic type. */ 772 /** The Symbol for storing type arguments on a specialized generic type. */
773 dart.typeArguments = Symbol('typeArguments'); 773 dart.typeArguments = Symbol('typeArguments');
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 dart.void = { toString() { return 'void'; } }; 930 dart.void = { toString() { return 'void'; } };
931 dart.bottom = { toString() { return 'bottom'; } }; 931 dart.bottom = { toString() { return 'bottom'; } };
932 932
933 dart.global = window || global; 933 dart.global = window || global;
934 dart.JsSymbol = Symbol; 934 dart.JsSymbol = Symbol;
935 935
936 // TODO(jmesserly): hack to bootstrap the SDK 936 // TODO(jmesserly): hack to bootstrap the SDK
937 _js_helper = _js_helper || {}; 937 _js_helper = _js_helper || {};
938 _js_helper.checkNum = notNull; 938 _js_helper.checkNum = notNull;
939 939
940 _js_primitives = _js_primitives || {};
941 _js_primitives.printString = (s) => console.log(s);
942
940 })(dart || (dart = {})); 943 })(dart || (dart = {}));
OLDNEW
« no previous file with comments | « no previous file | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698