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

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: 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
Index: lib/runtime/dart_runtime.js
diff --git a/lib/runtime/dart_runtime.js b/lib/runtime/dart_runtime.js
index d81ba2aa6ca13b7cc9a0c53437f9883aeb0331c1..8e6ca14d2e2a31e24b31a485aa64a6a2b4dd30dd 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;

Powered by Google App Engine
This is Rietveld 408576698