Skip to content

Conversation

@mamod
Copy link
Owner

@mamod mamod commented Nov 12, 2015

first v1.0.0 development release

  • cached functions (experimental)
  • "this" key word
  • code refactoring
  • get_object

mamod added 11 commits November 6, 2015 00:50
- introducing new api
- code clean
- to_perl_object
Conflicts:
	lib/JavaScript/Duktape.pm
This is a simple benchmark for checking during v1.0.0 development
release, we need things to be as fast ass possible
- let duktape buffers return as JavaScript::Duktape::Object

- fix pusheing real (this) constructor by calling push_this
instead of using current heapptr
- removing buffer objects
- reusing functions
- adding get_object function
- return sub code refs immediately if object is function
- remove buffer tests
- cached functions
- javascript objects properities
- passing utf8 strings to objects
- adding method to cache perl function
- code clean and formatting

setting functions from perl to be used in jvascript
requires to keep a global reference to perl code ref
doing so is very expensive in case repeating for the same
method, think of timers, so a new api introduced

duk->cache(sub{})

this will call same sub over and over again, documentation needed
1- introducing this keyword (experimental)
now every pushed perl function will get it's own context
with "this" keyword calling from inside, "this" will return a JavaScript::duktape::Object instance.
this will reduce calling my $this = shift for every function call

2- push_function & push_perl_function/push_c_function
push_function will handle everything for you, it will push "this"
to your function call, and translate all returning data, while push_perl_function
is the raw api call that represents duktape push_c_function api call
and you need to handle everything by your own
- code clean
- functions from javascript will be called as methods after pushing current running context
- function caching reimplementation
- fix push_this test
@mamod mamod mentioned this pull request Nov 12, 2015
mamod added a commit that referenced this pull request Nov 12, 2015
@mamod mamod merged commit 78031b3 into master Nov 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants