Giter Club home page Giter Club logo

Comments (25)

dougwilson avatar dougwilson commented on July 24, 2024

I'll take a look into this. Any suggestions are welcome :)

from nodejs-depd.

dougwilson avatar dougwilson commented on July 24, 2024

Actually, I assume this just make a TypeError from our getThis() call?

from nodejs-depd.

jasisk avatar jasisk commented on July 24, 2024

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.

dougwilson avatar dougwilson commented on July 24, 2024

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.

jasisk avatar jasisk commented on July 24, 2024

Hah. Sorry. Those are the only two TypeErrors I've come across so far.

from nodejs-depd.

dougwilson avatar dougwilson commented on July 24, 2024

Cool. This is officially a bug at this point :)

from nodejs-depd.

jasisk avatar jasisk commented on July 24, 2024

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.

jasisk avatar jasisk commented on July 24, 2024
'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.

dougwilson avatar dougwilson commented on July 24, 2024

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.

jasisk avatar jasisk commented on July 24, 2024

Awesome! Thanks for your attention to this, Doug. 😀

from nodejs-depd.

dougwilson avatar dougwilson commented on July 24, 2024

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.

jasisk avatar jasisk commented on July 24, 2024

👍 looking forward to seeing what you come up with.

from nodejs-depd.

dougwilson avatar dougwilson commented on July 24, 2024

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.

dougwilson avatar dougwilson commented on July 24, 2024

I think I have it mostly working so far :)

from nodejs-depd.

dougwilson avatar dougwilson commented on July 24, 2024

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.

jasisk avatar jasisk commented on July 24, 2024

Hah. Sorry for opening up this can of worms. 😉

from nodejs-depd.

dougwilson avatar dougwilson commented on July 24, 2024

lol. It's no problem. We'll get this fixed :D!

from nodejs-depd.

dougwilson avatar dougwilson commented on July 24, 2024

Basically it seems like this part of V8 that is in Node.js 0.10 is buggy, lol

from nodejs-depd.

dougwilson avatar dougwilson commented on July 24, 2024

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.

jasisk avatar jasisk commented on July 24, 2024

Tried in my application and in my test cases. Everything works! Thanks, Doug!

from nodejs-depd.

dougwilson avatar dougwilson commented on July 24, 2024

Sweet :D I plan to publish tonight (US Eastern time) as version 1.0.1

from nodejs-depd.

jasisk avatar jasisk commented on July 24, 2024

Sounds good! Thanks again!

from nodejs-depd.

jasisk avatar jasisk commented on July 24, 2024

I see it was released. Thanks again, Doug!

from nodejs-depd.

dougwilson avatar dougwilson commented on July 24, 2024

No problem! Sorry, I got too busy last night to make the release :(

from nodejs-depd.

jasisk avatar jasisk commented on July 24, 2024

Haha. Not a problem at all. I appreciate it!

from nodejs-depd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.