FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
vuln_javascript/javascript_element.cpp at master · lcatro/vuln_javascript · GitHub
lcatro
vuln_javascript
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
vuln_javascript
/
javascript_element.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (40 loc) · 1.79 KB
Breadcrumbs
vuln_javascript
/
javascript_element.cpp
Copy path
File metadata and controls
48 lines (40 loc) · 1.79 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#
include
"
disable_warning.h
"
#
include
<
memory.h
>
#
include
"
baselib_string.h
"
#
include
"
global_setting.h
"
#
include
"
javascript_base.h
"
#
include
"
javascript_element.h
"
#
include
"
javascript_variant.h
"
base_element::base_element
() {
this
->
attribute_table
.
attribute_name_list
.
clear
();
memset
(&
this
->
attribute_table
.
attribute_data_list
,
0
,
sizeof
(
this
->
attribute_table
.
attribute_data_list
));
}
base_element::~base_element
() {
}
void
base_element::remove
(
void
) {
#
ifdef
HEAP_ALLOC
free_memory
(
this
);
#
else
delete
this
;
#
endif
}
void
base_element::getAttribute
(string attribute) {
unsigned
long
attribute_index=
0
;
set_variant
(
JAVASCRIPT_VARIANT_KEYNAME_FUNCTION_RESULT
,(
void
*)
0
,
NUMBER
);
for
(attribute_string_list::iterator attribute_iterator=
this
->
attribute_table
.
attribute_name_list
.
begin
();
attribute_iterator!=
this
->
attribute_table
.
attribute_name_list
.
end
();
++attribute_iterator,++attribute_index)
if
(attribute==*attribute_iterator)
set_variant
(
JAVASCRIPT_VARIANT_KEYNAME_FUNCTION_RESULT
,(
void
*)
this
->
attribute_table
.
attribute_data_list
[attribute_index],
NUMBER
);
}
void
base_element::setAttribute
(string attribute,
void
* data) {
unsigned
long
attribute_index=
0
;
for
(attribute_string_list::iterator attribute_iterator=
this
->
attribute_table
.
attribute_name_list
.
begin
();
attribute_iterator!=
this
->
attribute_table
.
attribute_name_list
.
end
();
++attribute_iterator,++attribute_index)
if
(attribute==*attribute_iterator)
goto
SET_VALUE
;
this
->
attribute_table
.
attribute_name_list
.
push_back
(attribute);
SET_VALUE
:
this
->
attribute_table
.
attribute_data_list
[attribute_index]=(
unsigned
long
)data;
}
Back
|
FazBrowse Home
|
New Git URL