[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:
Nicholas Shahan 2023-05-15 18:57:43 +00:00 committed by Commit Queue
parent 6250eeca95
commit 4adf002b1d

View file

@ -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'))