@ball-lang/engine 1.3.6 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/compiled_engine.ts
CHANGED
|
@@ -677,17 +677,9 @@ function __ball_cascade(target: any, ops: any[]): any {
|
|
|
677
677
|
Object.defineProperty(sp, 'isNotEmpty', {
|
|
678
678
|
configurable: true, get() { return this.length !== 0; },
|
|
679
679
|
});
|
|
680
|
-
//
|
|
681
|
-
//
|
|
682
|
-
//
|
|
683
|
-
const _origObjDefProp = Object.defineProperty;
|
|
684
|
-
for (const boolProp of ['isEmpty', 'isNotEmpty']) {
|
|
685
|
-
if (!(undefined as any)?.[boolProp]) {
|
|
686
|
-
// Can't add properties to undefined/null, but we handle it in the
|
|
687
|
-
// generated code via ?.isEmpty fallback patterns. The preamble's
|
|
688
|
-
// protoWrap handles most cases.
|
|
689
|
-
}
|
|
690
|
-
}
|
|
680
|
+
// Note: undefined/null safety for .isEmpty/.isNotEmpty is handled in the
|
|
681
|
+
// generated code via optional-chaining (?.isEmpty) patterns and protoWrap;
|
|
682
|
+
// properties cannot be installed on undefined/null directly.
|
|
691
683
|
// Dart String methods not on JS String.
|
|
692
684
|
if (!sp.contains) sp.contains = function (s: any) { return this.includes(s); };
|
|
693
685
|
if (!sp.replaceFirst) sp.replaceFirst = function (from: any, to: any) {
|
|
@@ -893,7 +885,6 @@ function __ball_cascade(target: any, ops: any[]): any {
|
|
|
893
885
|
return Object.keys(this).filter((k: string) => !k.startsWith('__')).length;
|
|
894
886
|
});
|
|
895
887
|
|
|
896
|
-
// Number polyfills moved earlier (see "Dart Number polyfills" block above).
|
|
897
888
|
// runtimeType — Dart's Object.runtimeType. Returns the Dart-style
|
|
898
889
|
// type name for any JS value. Used by the compiled engine for type
|
|
899
890
|
// checking and error messages.
|
|
@@ -1894,6 +1885,10 @@ export class BallEngine {
|
|
|
1894
1885
|
} else {
|
|
1895
1886
|
if ((('arg' + __ball_to_string(i)) in inputMap)) {
|
|
1896
1887
|
scope.bind(p, __ball_index(inputMap, ('arg' + __ball_to_string(i))));
|
|
1888
|
+
} else {
|
|
1889
|
+
if ((((__ball_eq(i, 0) && __ball_eq(params.length, 1)) && ('value' in inputMap)) && this._isSetter(func))) {
|
|
1890
|
+
scope.bind(p, __ball_index(inputMap, 'value'));
|
|
1891
|
+
}
|
|
1897
1892
|
}
|
|
1898
1893
|
}
|
|
1899
1894
|
}
|