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

Unified Diff: lib/runtime/dart_sdk.js

Issue 1969683002: Update _charCodeApply, makeFixedStringUnmodifiable (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 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:
Download patch
« no previous file with comments | « no previous file | tool/input_sdk/patch/internal_patch.dart » ('j') | tool/input_sdk/patch/internal_patch.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_sdk.js
diff --git a/lib/runtime/dart_sdk.js b/lib/runtime/dart_sdk.js
index 031a2a3cd8874f6b67c3ec17c7214ff5cdb444ef..2019a3f2b3023e75ee623d7f532d3863ed154c49 100644
--- a/lib/runtime/dart_sdk.js
+++ b/lib/runtime/dart_sdk.js
@@ -6375,9 +6375,9 @@ dart_library.library('dart_sdk', null, /* Imports */[
};
dart.lazyFn(_internal.makeListFixedLength, () => [E => [core.List$(E), [core.List$(E)]]]);
_internal.makeFixedListUnmodifiable = function(E) {
- return list => {
- _interceptors.JSArray.markUnmodifiableList(list);
- return list;
+ return fixedLengthList => {
+ _interceptors.JSArray.markUnmodifiableList(fixedLengthList);
+ return fixedLengthList;
};
};
dart.lazyFn(_internal.makeFixedListUnmodifiable, () => [E => [core.List$(E), [core.List$(E)]]]);
@@ -9163,17 +9163,15 @@ dart_library.library('dart_sdk', null, /* Imports */[
return null;
}
static _fromCharCodeApply(array) {
- let result = "";
let kMaxApply = 500;
let end = array[dartx.length];
+ if (dart.notNull(end) <= kMaxApply) {
+ return String.fromCharCode.apply(null, array);
+ }
+ let result = '';
for (let i = 0; i < dart.notNull(end); i = i + kMaxApply) {
- let subarray = null;
- if (dart.notNull(end) <= kMaxApply) {
- subarray = array;
- } else {
- subarray = array.slice(i, i + kMaxApply < dart.notNull(end) ? i + kMaxApply : end);
- }
- result = result + String.fromCharCode.apply(null, subarray);
+ let chunkEnd = i + kMaxApply < dart.notNull(end) ? i + kMaxApply : end;
+ result = result + String.fromCharCode.apply(null, array.slice(i, chunkEnd));
}
return result;
}
« no previous file with comments | « no previous file | tool/input_sdk/patch/internal_patch.dart » ('j') | tool/input_sdk/patch/internal_patch.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698