...
 
Commits (12)
......@@ -101,7 +101,7 @@ minijasmine_LDADD = $(GJS_LIBS) libgjs.la
### TEST GIRS ##########################################################
TEST_INTROSPECTION_GIRS =
common_test_ldflags = -avoid-version
common_test_ldflags = $(AM_LDFLAGS) -avoid-version
common_test_libadd = $(GJS_LIBS)
if !BUILDOPT_INSTALL_TESTS
......
......@@ -17,9 +17,10 @@ check_LTLIBRARIES =
INTROSPECTION_GIRS =
## ACLOCAL_AMFLAGS can be removed for Automake 1.13
ACLOCAL_AMFLAGS = -I m4
AM_CXXFLAGS = $(WARN_CXXFLAGS) $(CODE_COVERAGE_CFLAGS)
AM_CFLAGS = $(WARN_CFLAGS) $(CODE_COVERAGE_CFLAGS)
AM_CXXFLAGS = $(WARN_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS)
AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gjs\" $(CODE_COVERAGE_CPPFLAGS)
AM_LDFLAGS = $(WARN_LDFLAGS) $(CODE_COVERAGE_LDFLAGS)
AM_LDFLAGS = $(WARN_LDFLAGS) $(CODE_COVERAGE_LIBS)
MAINTAINERCLEANFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
$(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \
......@@ -66,6 +67,7 @@ libgjs_la_CPPFLAGS = \
-I$(top_srcdir)/gi \
-DGJS_COMPILATION
libgjs_la_LDFLAGS = \
$(AM_LDFLAGS) \
-export-symbols-regex "^[^_]" \
-version-info 0:0:0 \
$(NO_UNDEFINED_FLAG) \
......@@ -153,7 +155,7 @@ gjs_console_CPPFLAGS = \
gjs_console_LDADD = \
$(GJS_CONSOLE_LIBS) \
libgjs.la
gjs_console_LDFLAGS = -rdynamic
gjs_console_LDFLAGS = $(AM_LDFLAGS) -rdynamic
gjs_console_SOURCES = $(gjs_console_srcs)
install-exec-hook:
......
......@@ -3,7 +3,7 @@
## Setting up ##
For the time being, we recommend using JHBuild to develop GJS.
Follow the [instructions from GNOME][jhbuild].
Follow the [instructions from GNOME](https://wiki.gnome.org/HowDoI/Jhbuild) for [JHBuild](https://git.gnome.org/browse/jhbuild/).
Even if your system includes a development package for mozjs, we
recommend building it on JHBuild so that you can enable the debugging
......@@ -133,4 +133,4 @@ xdg-open ~/.cache/jhbuild/build/gjs/gjs-X.Y.Z-coverage/index.html
(replace `X.Y.Z` with the version number, e.g. `1.48.0`)
[jhbuild] https://wiki.gnome.org/HowDoI/Jhbuild
[JHBuild](https://wiki.gnome.org/HowDoI/Jhbuild)
\ No newline at end of file
......@@ -109,8 +109,21 @@
fun:malloc
fun:g_malloc
...
fun:gtk_style_new
fun:gtk_widget_get_default_style
fun:gtk_css_node_declaration_make_writable
...
fun:gtk_style_constructed
}
{
gtk-style-context2
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
fun:g_malloc
...
fun:gtk_css_node_declaration_make_writable_resize
...
fun:gtk_style_constructed
}
# https://bugs.freedesktop.org/show_bug.cgi?id=105466
......
......@@ -82,13 +82,15 @@ FrameTicker.prototype = {
this._currentTime = 0;
let me = this;
this._timeoutID = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
Math.floor(1000 / me.FRAME_RATE),
function() {
me._currentTime += 1000 / me.FRAME_RATE;
me.emit('prepare-frame');
return true;
});
this._timeoutID = GLib.timeout_add(
GLib.PRIORITY_DEFAULT,
Math.floor(1000 / me.FRAME_RATE),
function() {
me._currentTime += 1000 / me.FRAME_RATE;
me.emit('prepare-frame');
return true;
});
},
stop : function() {
......@@ -146,11 +148,11 @@ function _startEngine() {
_tweenList = new Array();
if (!_ticker) {
throw new Error("Must call setFrameTicker()");
throw new Error('Must call setFrameTicker()');
}
_prepareFrameId = _ticker.connect('prepare-frame',
_onEnterFrame);
_onEnterFrame);
_ticker.start();
}
......@@ -166,7 +168,7 @@ function _stopEngine() {
_ticker.stop();
}
function _getCurrentTweeningTime(tweening) {
function _getCurrentTweeningTime() {
return _ticker.getTime();
}
......@@ -205,7 +207,7 @@ function _callOnFunction(fn, fnname, scope, fallbackScope, params)
try {
fn.apply(eventScope, params);
} catch (e) {
logError(e, "Error calling " + fnname);
logError(e, 'Error calling ' + fnname);
}
}
}
......@@ -236,8 +238,8 @@ function _updateTweenByIndex(i) {
nv = tweening.transition(t, b, c, d);
if (currentTime >= nv) {
_callOnFunction(tweening.onUpdate, "onUpdate", tweening.onUpdateScope,
scope, tweening.onUpdateParams);
_callOnFunction(tweening.onUpdate, 'onUpdate', tweening.onUpdateScope,
scope, tweening.onUpdateParams);
tweening.timesCalled++;
if (tweening.timesCalled >= tweening.count) {
......@@ -262,8 +264,8 @@ function _updateTweenByIndex(i) {
}
if (!tweening.hasStarted) {
_callOnFunction(tweening.onStart, "onStart", tweening.onStartScope,
scope, tweening.onStartParams);
_callOnFunction(tweening.onStart, 'onStart', tweening.onStartScope,
scope, tweening.onStartParams);
for (name in tweening.properties) {
var pv;
......@@ -323,8 +325,8 @@ function _updateTweenByIndex(i) {
tweening.updatesSkipped = 0;
_callOnFunction(tweening.onUpdate, "onUpdate", tweening.onUpdateScope,
scope, tweening.onUpdateParams);
_callOnFunction(tweening.onUpdate, 'onUpdate', tweening.onUpdateScope,
scope, tweening.onUpdateParams);
} else {
tweening.updatesSkipped++;
......@@ -332,8 +334,8 @@ function _updateTweenByIndex(i) {
}
if (isOver) {
_callOnFunction(tweening.onComplete, "onComplete", tweening.onCompleteScope,
scope, tweening.onCompleteParams);
_callOnFunction(tweening.onComplete, 'onComplete', tweening.onCompleteScope,
scope, tweening.onCompleteParams);
}
return !isOver;
......@@ -450,17 +452,17 @@ function _constructPropertyList(obj) {
}
function PropertyInfo(valueStart, valueComplete, originalValueComplete,
arrayIndex, extra, isSpecialProperty,
modifierFunction, modifierParameters) {
arrayIndex, extra, isSpecialProperty,
modifierFunction, modifierParameters) {
this._init(valueStart, valueComplete, originalValueComplete,
arrayIndex, extra, isSpecialProperty,
modifierFunction, modifierParameters);
arrayIndex, extra, isSpecialProperty,
modifierFunction, modifierParameters);
}
PropertyInfo.prototype = {
_init: function(valueStart, valueComplete, originalValueComplete,
arrayIndex, extra, isSpecialProperty,
modifierFunction, modifierParameters) {
arrayIndex, extra, isSpecialProperty,
modifierFunction, modifierParameters) {
this.valueStart = valueStart;
this.valueComplete = valueComplete;
this.originalValueComplete = originalValueComplete;
......@@ -502,7 +504,7 @@ function _addTweenOrCaller(target, tweeningParameters, isCaller) {
} else {
for (var i = 0; i < scopes.length; i++) {
if (scopes[i][istr] == undefined)
log("The property " + istr + " doesn't seem to be a normal object property of " + scopes[i] + " or a registered special property");
log('The property ' + istr + ' doesn\'t seem to be a normal object property of ' + scopes[i] + ' or a registered special property');
}
}
}
......@@ -519,14 +521,14 @@ function _addTweenOrCaller(target, tweeningParameters, isCaller) {
var transition;
// FIXME: Tweener allows you to use functions with an all lower-case name
if (typeof obj.transition == "string") {
if (typeof obj.transition == 'string') {
transition = imports.tweener.equations[obj.transition];
} else {
transition = obj.transition;
}
if (!transition)
transition = imports.tweener.equations["easeOutExpo"];
transition = imports.tweener.equations['easeOutExpo'];
var tween;
......@@ -536,22 +538,22 @@ function _addTweenOrCaller(target, tweeningParameters, isCaller) {
var copyProperties = new Object();
for (istr in properties) {
copyProperties[istr] = new PropertyInfo(properties[istr].valueStart,
properties[istr].valueComplete,
properties[istr].valueComplete,
properties[istr].arrayIndex || 0,
{},
properties[istr].isSpecialProperty || false,
properties[istr].modifierFunction || null,
properties[istr].modifierParameters || null);
properties[istr].valueComplete,
properties[istr].valueComplete,
properties[istr].arrayIndex || 0,
{},
properties[istr].isSpecialProperty || false,
properties[istr].modifierFunction || null,
properties[istr].modifierParameters || null);
}
}
tween = new TweenList.TweenList(scopes[i],
_ticker.getTime() + ((delay * 1000) / _timeScale),
_ticker.getTime() + (((delay * 1000) + (time * 1000)) / _timeScale),
false,
transition,
obj.transitionParams || null);
_ticker.getTime() + ((delay * 1000) / _timeScale),
_ticker.getTime() + (((delay * 1000) + (time * 1000)) / _timeScale),
false,
transition,
obj.transitionParams || null);
tween.properties = isCaller ? null : copyProperties;
tween.onStart = obj.onStart;
......@@ -608,8 +610,12 @@ function addCaller(target, tweeningParameters) {
function _getNumberOfProperties(object) {
var totalProperties = 0;
for (let name in object)
// the following line is disabled becasue eslint was picking up the following error: the variable name is defined but never used, however since it is required to search the object it is used and we'll allow the line to be ignored to get rid of the error message
/* eslint-disable-next-line */
for (let name in object) {
totalProperties ++;
}
return totalProperties;
}
......@@ -630,8 +636,8 @@ function removeTweensByTime(scope, properties, timeStart, timeComplete) {
for (name in _tweenList[i].properties) {
if (properties[name]) {
if (!removedLocally) {
_callOnFunction(_tweenList[i].onOverwrite, "onOverwrite", _tweenList[i].onOverwriteScope,
_tweenList[i].scope, _tweenList[i].onOverwriteParams);
_callOnFunction(_tweenList[i].onOverwrite, 'onOverwrite', _tweenList[i].onOverwriteScope,
_tweenList[i].scope, _tweenList[i].onOverwriteParams);
}
_tweenList[i].properties[name] = undefined;
......@@ -763,7 +769,7 @@ function _affectTweensWithFunction(func, args) {
}
for (let i = 1; args[i] != undefined; i++) {
if (typeof(args[i]) == "string" && !_isInArray(args[i], properties)) {
if (typeof(args[i]) == 'string' && !_isInArray(args[i], properties)) {
if (_specialPropertySplitterList[args[i]]) {
// special property, get splitter array first
var sps = _specialPropertySplitterList[arguments[i]];
......@@ -836,7 +842,7 @@ function getTweenCount(scope) {
}
function registerSpecialProperty(name, getFunction, setFunction,
parameters, preProcessFunction) {
parameters, preProcessFunction) {
_specialPropertyList[name] = {
getValue: getFunction,
setValue: setFunction,
......
......@@ -36,7 +36,7 @@ function do_Configure_MainBuild(){
echo '-- Set Main JHBuild Configuration --'
mkdir -p ~/.config
autogenargs="--enable-compile-warnings=error --with-xvfb-tests"
autogenargs="--enable-compile-warnings=yes --with-xvfb-tests"
if [[ -n "${BUILD_OPTS}" ]]; then
autogenargs="$autogenargs $BUILD_OPTS"
......
......@@ -27,6 +27,12 @@ function do_Set_Env(){
echo '-- Done --'
}
function do_Done(){
# Done. De-initializes whatever is needed
echo
echo '-- FINISHED --'
}
function do_Build_Package_Dependencies(){
echo
echo "-- Building Dependencies for $1 --"
......@@ -58,6 +64,15 @@ function do_Show_Info(){
function do_Get_Upstream_Master(){
if [[ "$CI_BUILD_REF_SLUG" == "master" && "$CI_PROJECT_PATH_SLUG" == "gnome-gjs" ]]; then
echo '--------------------------------'
echo 'Running against upstream master'
echo "=> $1 Nothing to do"
do_Done
exit 0
fi
echo '--------------------------------'
echo 'Cloning upstream master'
......@@ -110,7 +125,7 @@ mkdir -p "$save_dir"/tokei; touch "$save_dir"/tokei/doing-"$1"
# Allow CI to skip jobs. Its goal is to simplify housekeeping.
# Disable tasks using the commit message. Possibilities are (and/or):
# [skip eslint] [skip cpplint] [skip cppcheck]
export log_message=$(git log -n 1)
log_message=$(git log -n 1)
if [[ $1 == "GJS" ]]; then
do_Set_Env
......@@ -143,7 +158,7 @@ if [[ $1 == "GJS" ]]; then
jhbuild make --check
else
export AM_DISTCHECK_CONFIGURE_FLAGS="--enable-compile-warnings=error --with-xvfb-tests"
export AM_DISTCHECK_CONFIGURE_FLAGS="--enable-compile-warnings=yes --with-xvfb-tests"
# Regular (autotools only) build
echo "Autogen options: $ci_autogenargs"
......@@ -205,7 +220,7 @@ elif [[ $1 == "CPPCHECK" && "$log_message" != *'[skip cppcheck]'* ]]; then
echo
# Get the code committed at upstream master
do_Get_Upstream_Master
do_Get_Upstream_Master "cppCheck"
cppcheck --inline-suppr --enable=warning,performance,portability,information,missingInclude --force -q . 2>&1 | \
tee "$save_dir"/cppcheck/master-report.txt | sed -E 's/:[0-9]+]/:LINE]/' > /cwd/master-report.txt
echo
......@@ -222,7 +237,7 @@ elif [[ $1 == "CPPLINT" && "$log_message" != *'[skip cpplint]'* ]]; then
echo
# Get the code committed at upstream master
do_Get_Upstream_Master
do_Get_Upstream_Master "cppLint"
cpplint --quiet $(find . -name \*.cpp -or -name \*.c -or -name \*.h | sort) 2>&1 | \
tee "$save_dir"/cpplint/master-report.txt | sed -E 's/:[0-9]+:/:LINE:/' > /cwd/master-report.txt
echo
......@@ -231,7 +246,7 @@ elif [[ $1 == "CPPLINT" && "$log_message" != *'[skip cpplint]'* ]]; then
do_Compare_With_Upstream_Master "cppLint"
elif [[ $1 == "ESLINT" && "$log_message" != *'[skip eslint]'* ]]; then
tmp_path=$(dirname $CI_PROJECT_DIR)
tmp_path=$(dirname "$CI_PROJECT_DIR")
echo
echo '-- Javascript linter report --'
......@@ -243,7 +258,7 @@ elif [[ $1 == "ESLINT" && "$log_message" != *'[skip eslint]'* ]]; then
echo
# Get the code committed at upstream master
do_Get_Upstream_Master
do_Get_Upstream_Master "esLint"
cp "$save_dir"/.eslint* .
eslint examples installed-tests modules --format unix 2>&1 | \
tee "$save_dir"/eslint/master-report.txt | \
......@@ -261,6 +276,6 @@ elif [[ $1 == "TOKEI" ]]; then
tokei . | tee "$save_dir"/tokei/report.txt
fi
# Done
echo
echo '-- DONE --'
# Releases stuff and finishes
do_Done
......@@ -218,30 +218,6 @@ _Pragma("GCC diagnostic pop")
case GJS_DEBUG_GPARAM:
prefix = "JS G PRM";
break;
case GJS_DEBUG_DATABASE:
prefix = "JS DB";
break;
case GJS_DEBUG_RESULTSET:
prefix = "JS RS";
break;
case GJS_DEBUG_WEAK_HASH:
prefix = "JS WEAK";
break;
case GJS_DEBUG_MAINLOOP:
prefix = "JS MAINLOOP";
break;
case GJS_DEBUG_PROPS:
prefix = "JS PROPS";
break;
case GJS_DEBUG_SCOPE:
prefix = "JS SCOPE";
break;
case GJS_DEBUG_HTTP:
prefix = "JS HTTP";
break;
case GJS_DEBUG_BYTE_ARRAY:
prefix = "JS BYTE ARRAY";
break;
case GJS_DEBUG_GERROR:
prefix = "JS G ERR";
break;
......
......@@ -48,14 +48,6 @@ typedef enum {
GJS_DEBUG_GBOXED,
GJS_DEBUG_GENUM,
GJS_DEBUG_GPARAM,
GJS_DEBUG_DATABASE,
GJS_DEBUG_RESULTSET,
GJS_DEBUG_WEAK_HASH,
GJS_DEBUG_MAINLOOP,
GJS_DEBUG_PROPS,
GJS_DEBUG_SCOPE,
GJS_DEBUG_HTTP,
GJS_DEBUG_BYTE_ARRAY,
GJS_DEBUG_GERROR,
GJS_DEBUG_GFUNDAMENTAL,
} GjsDebugTopic;
......