Skip to content

Commit d73840d

Browse files
committed
rename to JavaScript::V8
1 parent 239f684 commit d73840d

13 files changed

+53
-181
lines changed

IntAndString.cc

-30
This file was deleted.

IntAndString.h

-25
This file was deleted.

Makefile.PL

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ use ExtUtils::MakeMaker;
66
my $CC = 'g++';
77

88
WriteMakefile(
9-
NAME => 'Object::WithIntAndString',
10-
VERSION_FROM => 'lib/Object/WithIntAndString.pm', # finds $VERSION
9+
NAME => 'JavaScript::V8',
10+
VERSION_FROM => 'lib/JavaScript/V8.pm', # finds $VERSION
1111
PREREQ_PM => {
1212
'ExtUtils::XSpp' => '0.01',
1313
}, # e.g., Module::Name => 1.1
1414
($] >= 5.005 ? ## Add these new keywords supported since 5.005
15-
(ABSTRACT_FROM => 'lib/Object/WithIntAndString.pm', # retrieve abstract from module
16-
AUTHOR => 'Steffen Mueller <smueller@cpan.org>') : ()),
17-
LIBS => [''], # e.g., '-lm'
15+
(ABSTRACT_FROM => 'lib/JavaScript/V8.pm', # retrieve abstract from module
16+
AUTHOR => 'Pawel Murias <pawelmurias@gmail.org>') : ()),
17+
LIBS => ['-lv8'], # e.g., '-lm'
1818
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
1919
INC => '-I.', # e.g., '-I. -I/usr/include/other'
2020
OBJECT => '$(O_FILES)', # link all the C files too

Object-WithIntAndString.xsp

-33
This file was deleted.

V8Context.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <v8.h>
2+
#include "V8Context.h"
3+
using namespace v8;
4+
void V8Context::eval(const char* source) {
5+
/* HandleScope handle_scope;
6+
Persistent<Context> context = Context::New();
7+
Context::Scope context_scope(context);
8+
Handle<Script> script = Script::Compile(String::New(source));
9+
Handle<Value> result = script->Run();
10+
context.Dispose();*/
11+
}
12+
13+
14+

V8Context.h

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef _V8Context_h_
2+
#define _V8Context_h_
3+
4+
#include <string>
5+
6+
class V8Context {
7+
public:
8+
V8Context() {}
9+
~V8Context() {}
10+
11+
void eval(const char* code);
12+
13+
private:
14+
};
15+
16+
#endif
17+

WithIntAndString.xs WithV8Context.xs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ extern "C" {
88
#endif
99

1010
/* include your class headers here */
11-
#include "IntAndString.h"
11+
#include "V8Context.h"
1212

1313
/* We need one MODULE... line to start the actual XS section of the file.
1414
* The XS++ preprocessor will output its own MODULE and PACKAGE lines */
15-
MODULE = Object::WithIntAndString PACKAGE = Object::WithIntAndString
15+
MODULE = Javascript::V8 PACKAGE = Javascript::V8
1616

1717
## The include line executes xspp with the supplied typemap and the
1818
## xsp interface code for our class.
1919
## It will include the output of the xsubplusplus run.
2020

21-
INCLUDE: xspp --typemap=typemap.xsp Object-WithIntAndString.xsp |
21+
INCLUDE: xspp --typemap=typemap.xsp Javascript-V8-Context.xsp |
2222

2323

lib/JavaScript/V8.pm

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package JavaScript::V8;
2+
use 5.006001;
3+
use strict;
4+
use warnings;
5+
6+
our $VERSION = '0.01';
7+
8+
require XSLoader;
9+
XSLoader::load('JavaScript::V8', $VERSION);
10+
11+
1;

lib/Object/WithIntAndString.pm

-43
This file was deleted.

t/01load.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
use Test::More tests => 1;
2-
BEGIN { use_ok('Object::WithIntAndString') };
2+
BEGIN { use_ok('JavaScript::V8') };
33

t/02test.t

-39
This file was deleted.

typemap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
TYPEMAP
2-
IntAndString* O_OBJECT
2+
V8Context* O_OBJECT
33

typemap.xsp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
// Map the type of our custom class
3-
%typemap{IntAndString*}{simple};
3+
%typemap{V8Context*}{simple};
44

55
// Map simple types
66
%typemap{const char*}{simple};

0 commit comments

Comments
 (0)