mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 20:11:19 +00:00
[ddc] Remove __proto__
use from js_array.dart
Issue: https://github.com/dart-lang/sdk/issues/52372 Change-Id: I65ddae15e31ea85a431a62c8b4454710503fd30f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303085 Commit-Queue: Nicholas Shahan <nshahan@google.com> Reviewed-by: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
parent
6250eeca95
commit
4adf002b1d
|
@ -24,7 +24,7 @@ class JSArray<E> extends JavaScriptObject
|
|||
//
|
||||
// TODO(jmesserly): this uses special compiler magic to close over the
|
||||
// parameterized ES6 'JSArray' class.
|
||||
JS('', '#.__proto__ = JSArray.prototype', list);
|
||||
jsObjectSetPrototypeOf(list, JS('', 'JSArray.prototype'));
|
||||
if (JS_GET_FLAG('NEW_RUNTIME_TYPES'))
|
||||
JS('', '#.# = #', list, JS_EMBEDDED_GLOBAL('', ARRAY_RTI_PROPERTY),
|
||||
JSArray<E>);
|
||||
|
@ -33,7 +33,7 @@ class JSArray<E> extends JavaScriptObject
|
|||
|
||||
// TODO(jmesserly): consider a fixed array subclass instead.
|
||||
factory JSArray.fixed(list) {
|
||||
JS('', '#.__proto__ = JSArray.prototype', list);
|
||||
jsObjectSetPrototypeOf(list, JS('', 'JSArray.prototype'));
|
||||
JS('', r'#.fixed$length = Array', list);
|
||||
if (JS_GET_FLAG('NEW_RUNTIME_TYPES'))
|
||||
JS('', '#.# = #', list, JS_EMBEDDED_GLOBAL('', ARRAY_RTI_PROPERTY),
|
||||
|
@ -42,7 +42,7 @@ class JSArray<E> extends JavaScriptObject
|
|||
}
|
||||
|
||||
factory JSArray.unmodifiable(list) {
|
||||
JS('', '#.__proto__ = JSArray.prototype', list);
|
||||
jsObjectSetPrototypeOf(list, JS('', 'JSArray.prototype'));
|
||||
JS('', r'#.fixed$length = Array', list);
|
||||
JS('', r'#.immutable$list = Array', list);
|
||||
if (JS_GET_FLAG('NEW_RUNTIME_TYPES'))
|
||||
|
|
Loading…
Reference in a new issue