Comments (13)
Was this issue solved?
I've looked around a bit and haven't found this. I found some calls to the defaultValue() function so I guess this was solved.
from cesium.
There are still places where this is an issue, but they are hard to track down so we have been fixing them when we find them. If you feel like going through the code and looking for them and fixing them, that would be awesome. It's not just this.myValue = value || 12.0;
but also if(myValue)
where myValue is not a boolean, that needs to be fixed.
from cesium.
One thing to keep in mind, though, is that the defaultValue(a, b)
function can introduce performance problems if b
is not a constant value or primitive value, because both a
and b
must be evaluated in order to call the function. In cases where b
is an allocated object, we need to stick with the typeof a !== 'undefined' ? a : b
pattern. See this discussion for more details.
from cesium.
@Andre-Nunes if you are interested in this, you could start with a few files, which we could review to make sure you are heading in the right direction before updating everything. This would be a welcomed contribution.
from cesium.
@pjcozzi , I am really interested in this, it's a good way to start dwelling into the code base and prepare myself for GSoC.
I would really appreciate if someone pointed me in the right direction. For example on Cesium-hint.js:
var win = CodeMirror.cesiumWindow || window;
if (context) {
// If this is a property, see if it belongs to some object we can
// find in the current environment.
var obj = context.pop(), base;
if (obj.className == "variable")
base = win[obj.string];
else if (obj.className == "string")
base = "";
else if (obj.className == "atom")
base = 1;
else if (obj.className == "function") {
if (win.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&
(typeof win.jQuery == 'function'))
base = win.jQuery();
else if (win._ != null && (obj.string == '_') && (typeof win._ == 'function'))
base = win._();
}
Is win
a suitable candidate for fix?
A different example this time on CubeMapEllipsoidTessellator.js
attributeName = attributeName || 'position';
This is probably not the best way to review code so any advice will be welcome.
from cesium.
Yes. Both win
, context
and attributeName
are all cases where we should be performing a proper check.
from cesium.
I'll start by fixing those then. Should I open a pull request as soon as I fix those or that's just 'overkill'?
I've asked further questions about branching and "commit etiquette" on the forum. It's probability better to continue this discussion there.
from cesium.
Hang on, Cesium-hint.js
is a special case. It's a modified copy of a third-party file, ThirdParty\CodeMirror-2.24\lib\util\javascript-hint.js
, with some Cesium customizations. Because it's a fork of that file, I want to keep the customizations to a minimum, so it's upgradable. Please don't "fix" anything in that file, thanks!
from cesium.
@emackey Kind of offtopic but if that's the case, shouldn't Cesium-hint.js be in a Sandcastle/ThirdParty directory? And why not just keep it named javascript-hint.js?
from cesium.
Might be good to move it down into a new Sandcastle/Thirdparty folder, this issue seems to come up from time to time. Note that you'll have to mess with the jsHint options for Eclipse after you move or rename it. I do like the name Cesium-hint because the file contains more than just plain JavaScript hints, it's been customized for Cesium.
from cesium.
@Andre-Nunes For something like this you should either open a new issue or post a new message to the mailing list. Please do not post about an unrelated issue in some other issue, it makes things difficult to manage.
from cesium.
I believe this was solved with the above PRs, after #694 I've gone through most Source files as well, is there anywhere else I should look at?
from cesium.
While I'm sure there are some remaining cases that we'll find over time, I think the majority of them have been fixed. Thanks for the work @Andre-Nunes and @nobelium!
from cesium.
Related Issues (20)
- viewer.ready is undefined HOT 1
- async version of Resource Proxy getURL HOT 3
- 3D models rendering is wrong with vertical exaggeration above 1 HOT 6
- Add support for glTF KHR_materials_specular extension
- Turn off vertical exaggeration for some Models in the Scene HOT 4
- Cesium Install Fails on Gentoo @Playwright HOT 3
- Create points and billboards set different colors, execute clear all entities, and then create again, the color of the point will apply the color of the billboard HOT 1
- How can set Material class->fabric->uniforms->texture in repeat Mode ?default is clamp HOT 1
- Billboards rendering partially in 2D at particular zoom level HOT 1
- strokeWidth setting does not take effect HOT 2
- Add serial numbers to each demo in Sandcastle HOT 1
- Two node_modules directories need to be added to.gitignore HOT 3
- Cesium3DTileset flickers in large data. HOT 3
- Add `cspell` checking
- Orthographic camera projection HOT 4
- Can the options in WebMapServiceImageryProvider support customTags field? HOT 6
- `Unhandled promise rejection: undefined thrown` in CI
- External tilesets are disallowed inside multiple contents
- valid glTF fails to load in CesiumJS HOT 3
- Can't find ion-sdk-widgets/Source/TransformEditor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cesium.