GithubHelp home page GithubHelp logo

objj-runtime's People

Contributors

alfredwarnsater avatar mrcarlberg avatar tancred avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

objj-runtime's Issues

Undefined identifier

Hello :)

Honestly, I had no real good idea for a name for this issue... So, I will let code talk for me instead:

[email protected] ~/W/T/objj $ objj test.j
../test.j:14
    (Speaker.isa.method_msgSend["speak"] || _objj_forward)(Speaker, "speak");
                               ^

TypeError: Cannot read property 'speak' of undefined
    at main (../test.j:14:32)
    at Object.exports.run (/usr/local/lib/node_modules/objj-runtime/lib/objective-j.js:4389:21)
    at Object.<anonymous> (/usr/local/lib/node_modules/objj-runtime/bin/objj:3:31)
    at Module._compile (internal/modules/cjs/loader.js:738:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
    at Module.load (internal/modules/cjs/loader.js:630:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
    at Function.Module._load (internal/modules/cjs/loader.js:562:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:801:12)
    at internal/main/run_main_module.js:21:11
[email protected] ~/W/T/objj $ objjc ./test.j --ecma5 -o test.js
[email protected] ~/W/T/objj $ cat test.js
{var the_class = objj_allocateClassPair(Nil, "Speaker"),
meta_class = the_class.isa;objj_registerClassPair(the_class);
class_addMethods(meta_class, [new objj_method(sel_getUid("speak"), function $Speaker__speak(self, _cmd)
{
    console.log("Hello!");
}

,["id"])]);
}
function main(args, namedArgs)
{
    (Speaker.isa.method_msgSend["speak"] || _objj_forward)(Speaker, "speak");
}
[email protected] ~/W/T/objj $ cat test.j
@implementation Speaker {}
+(id) speak {
  console.log("Hello!");
}
@end

function main(args, namedArgs) {
  [Speaker speak];
}

Why is Speaker not being defined as a variable?

Thanks in advance!

Kind regards,
Ingwie

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.