Comments (25)
I'll take a look into this. Any suggestions are welcome :)
from nodejs-depd.
Actually, I assume this just make a TypeError
from our getThis()
call?
from nodejs-depd.
Not super familiar with the call stack api or your normalization stuff, figured I'd capture the issue before diving in to your caller resolution stuff.
getThis
fails but so does getTypeName
because TypeError: Cannot read property 'constructor' of undefined
.
from nodejs-depd.
That's fine. Really, I just need a definition of what "causing problems" from your title means. Are there Errors being thrown? If so what are they? If not, what's happening?
from nodejs-depd.
Hah. Sorry. Those are the only two TypeErrors I've come across so far.
from nodejs-depd.
Cool. This is officially a bug at this point :)
from nodejs-depd.
I'll write a test case for realizing a getThis()
failure. The getTypeName()
can be seen in the existing test by adding 'use strict';
to the my-lib
fixture.
from nodejs-depd.
'use strict';
var dep = require('depd')('dep');
var inc = dep.function(function deprecated() {});
inc.apply(inc);
/Users/jsisk/tmp/depd/node_modules/depd/index.js:292
typeName = callSite.getThis().name || typeName
^
TypeError: Cannot read property 'name' of undefined
at defaultMessage (/Users/jsisk/tmp/depd/node_modules/depd/index.js:292:34)
at Function.log (/Users/jsisk/tmp/depd/node_modules/depd/index.js:235:9)
at Function.eval (eval at wrapfunction (/Users/jsisk/tmp/depd/node_modules/depd/index.js:414:5), <anonymous>:3:5)
at Object.<anonymous> (/Users/jsisk/tmp/depd/index.js:4:5)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
from nodejs-depd.
Nice. I've found a bunch of issues playing with it already :) Hopefully I want to get a new patch version out tonight for this issue :D
from nodejs-depd.
Awesome! Thanks for your attention to this, Doug. 😀
from nodejs-depd.
No problem at all! The TypeError: Cannot read property 'constructor' of undefined
is the most odd-ball error of the bunch :) I'm looking through the native V8 code to determine the best way without adding a slow try
, haha
from nodejs-depd.
👍 looking forward to seeing what you come up with.
from nodejs-depd.
haha. and lol, this isn't super fun; seems V8 didn't completely think of all the different methods in their error API when they implemented use strict
, haha. Seems I have to replicate some of those in my code instead of calling the error API methods.
from nodejs-depd.
I think I have it mostly working so far :)
from nodejs-depd.
The worse part is that from those API docs:
For those frames, getFunction() and getThis() will return undefined.
This is true... but not for Node.js < 0.12, which throw on getTypeName()
from a bug, but Node.js 0.12+ correctly gets the type name.
from nodejs-depd.
Hah. Sorry for opening up this can of worms. 😉
from nodejs-depd.
lol. It's no problem. We'll get this fixed :D!
from nodejs-depd.
Basically it seems like this part of V8 that is in Node.js 0.10 is buggy, lol
from nodejs-depd.
Ok, so hopefully it's all fixed on master
. If you'd be so kind to test using what you saw the issues with, that would be awesome :)
from nodejs-depd.
Tried in my application and in my test cases. Everything works! Thanks, Doug!
from nodejs-depd.
Sweet :D I plan to publish tonight (US Eastern time) as version 1.0.1
from nodejs-depd.
Sounds good! Thanks again!
from nodejs-depd.
I see it was released. Thanks again, Doug!
from nodejs-depd.
No problem! Sorry, I got too busy last night to make the release :(
from nodejs-depd.
Haha. Not a problem at all. I appreciate it!
from nodejs-depd.
Related Issues (20)
- Drop eval usage HOT 21
- line info is not help HOT 8
- Cannot redefine property: callSiteToString HOT 2
- Call-site calculation does not fail gracefully when Stack information is unavailable HOT 14
- Call site calculation fails when importing an esm'ed package that imports sequelize internally HOT 14
- Respect --no-deprecation and process.noDeprecation HOT 17
- TypeError: eval is not a function HOT 8
- Why is this library overwriting Error type? HOT 5
- Turkish Language Problem HOT 2
- Incopatibile with --enable-source-maps node 12 option HOT 7
- (!) Use of eval is strongly discouraged, rollup HOT 1
- compatibility with Node.js' source-map implementation HOT 12
- please rewrite nodejs-depd with modern syntax HOT 1
- Compatibility with --disallow-code-generation-from-strings HOT 9
- Use of eval() is strongly discouraged, as it poses security risks HOT 9
- Calling `process.cwd()` from index.js can be problematic HOT 4
- callSite.getFileName() is not Function HOT 5
- `callSite.getFileName` is not a function HOT 10
- NodeJS 20.11.0 fails when building snapshot.
- compatibility with node --frozen-intrinsics security option HOT 3
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 nodejs-depd.