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

Unified Diff: lib/runtime/dart_runtime.js

Issue 1071393007: fuse List and js Array together and a few other misc fixes. (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: ptal Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/dart/core.js ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_runtime.js
diff --git a/lib/runtime/dart_runtime.js b/lib/runtime/dart_runtime.js
index d81ba2aa6ca13b7cc9a0c53437f9883aeb0331c1..b1d2f0012055b5bea48be84451d6563f56f32f10 100644
--- a/lib/runtime/dart_runtime.js
+++ b/lib/runtime/dart_runtime.js
@@ -9,6 +9,7 @@ var dart, _js_helper;
let defineProperty = Object.defineProperty;
let getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
let getOwnPropertyNames = Object.getOwnPropertyNames;
+ let getOwnPropertySymbols = Object.getOwnPropertySymbols;
// Adapted from Angular.js
let FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
@@ -614,11 +615,14 @@ var dart, _js_helper;
* This operation is commonly called `mixin` in JS.
*/
function copyProperties(to, from) {
- let names = getOwnPropertyNames(from);
- for (let i = 0; i < names.length; i++) {
- let name = names[i];
- defineProperty(to, name, getOwnPropertyDescriptor(from, name));
+ function copyPropertiesHelper(names) {
+ for (let i = 0; i < names.length; i++) {
+ let name = names[i];
+ defineProperty(to, name, getOwnPropertyDescriptor(from, name));
+ }
}
+ copyPropertiesHelper(getOwnPropertyNames(from));
+ copyPropertiesHelper(getOwnPropertySymbols(from));
return to;
}
dart.copyProperties = copyProperties;
@@ -804,6 +808,7 @@ var dart, _js_helper;
dart.void = { toString() { return 'void'; } };
dart.bottom = { toString() { return 'bottom'; } };
+ dart.global = window || global;
dart.JsSymbol = Symbol;
// TODO(jmesserly): hack to bootstrap the SDK
« no previous file with comments | « lib/runtime/dart/core.js ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698