GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Reading `SomeClass.null` permanently breaks that class's static `valueOf()` · Issue #1986 · NativeScript/android Open DescriptionSummaryReading the typed-null marker The This is not specific to any one class; it hits any class that has both a static ReproductionAny app, evaluated in the runtime (here via the inspector): String(java.lang.Double.valueOf(1)) // "1.0" <- correct typeof java.lang.Double.null // "function" <- touch the marker once String(java.lang.Double.valueOf(1)) // "null" <- now permanently broken java.lang.Double.toString(1) // "1.0" <- other statics unaffected The property is visibly deleted and re-added — Object.getOwnPropertyNames(java.lang.Double).indexOf("valueOf") // 19 (of 35) before Object.getOwnPropertyNames(java.lang.Double).indexOf("valueOf") // 34 (of 35) after
String(java.lang.String.valueOf(7)) // "null" Object.getOwnPropertyNames(java.lang.String) // [... "copyValueOf", "format", "join", "extend", "CASE_INSENSITIVE_ORDER", "null", "class", "valueOf"] // ^ moved to last Expected vs actual
Root cause
auto thiz = info.This(); // the class constructor function itself ... auto funcTemplate = FunctionTemplate::New(isolate, MetadataNode::NullValueOfCallback); thiz->Delete(context, V8StringConstants::GetValueOf(isolate)); thiz->Set(context, V8StringConstants::GetValueOf(isolate), funcTemplate->GetFunction(context).ToLocalChecked()); ... info.GetReturnValue().Set(thiz); // the marker IS the ctor function and args.GetReturnValue().SetNull(); So the "make this object read as null" shim is installed on the class object rather than on a distinct marker object, and it overwrites a real Java static of the same name. The guard around it ( Suggested directionReturn a dedicated marker object from the Failing that, at minimum the shim should not clobber a name that exists in the class's metadata. Affected versions
Tested on an API 35 arm64 emulator. ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |