In doing a little research on RangedPtr, I noticed several files that #include it without using it, all in the /js/src directory. Filing this bug on removing those #includes.
The files in question are: * jsarray.cpp - #include was added in https://hg.mozilla.org/mozilla-central/rev/570ff6efe5ef#l9.16 for bug 668024, apparently accidentally. (Nothing in that commit uses RangedPtr) * jsfun.cpp - #include was added in https://hg.mozilla.org/mozilla-central/rev/e080642175e6#l39.12 for Bug 761723. - That patch's RangedPtr usage was later replaced with StableCharPtr in bug 761723 * jsonparser.h - #include was added in https://hg.mozilla.org/mozilla-central/rev/739c0fd21ccc#l3.12 - That ptach's RangedPtr usage was later replaced with StableCharPtr in bug 798624
Created attachment 718865 [details] [diff] [review] fix
5 years ago
Just rediscovered this bug -- apparently I forgot to land its patch. Looks like the first chunk, for jsarray.cpp, was fixed in bug 634839 part 1: https://hg.mozilla.org/mozilla-central/rev/9ab1119d4596#l6.1 The other two chunks are still valid, though.
RE the jsonparser.h tweak: jsonparser.cpp (not .h) *does* actually have some RangedPtr usage, so it technically should be including RangedPtr. It gets it for free from jsapi, so it builds fine regardless, but it'd be better to include it directly rather than depending on a several-levels-removed #include.
Created attachment 744891 [details] [diff] [review] fix v2: rebased, and shifting the jsonparser #include to the .cpp file Tagging Waldo for review on the jsonparser.cpp tweak. (adding the #include there) (For completeness, the RangedPtr usages there are: http://mxr.mozilla.org/mozilla-central/source/js/src/jsonparser.cpp#207 and http://mxr.mozilla.org/mozilla-central/source/js/src/jsonparser.cpp#389 )
4 years ago