Skip to content

Commit

Permalink
fix(core): template type Observer::Callback should be specified with …
Browse files Browse the repository at this point in the history
…typename so the compiler knows its a type
  • Loading branch information
heapwolf committed May 16, 2024
1 parent a5c1952 commit c28cd63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions api/commonjs/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,11 @@ export class Name {
const organization = components[0]
let [name, version = null] = components[1].split('@')
pathname = [organization || '', name, ...components.slice(2)].filter(Boolean).join('/')

// manifest was given, this could be a nested package
if (hasManifest) {
name = [organization, name].filter(Boolean).concat(components.slice(2)).join('/')
return {
const r = {
name,
version,
organization,
Expand All @@ -189,6 +190,7 @@ export class Name {
isRelative,
hasManifest
}
return r
}

// only a organization was given, return `null`
Expand All @@ -198,7 +200,7 @@ export class Name {

name = `${organization}/${name}`

// only `@<org>/package>` was given
// only `@<org>/<package>` was given
if (components.length === 2) {
return {
name,
Expand Down
2 changes: 1 addition & 1 deletion src/core/module.hh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace SSC {
Vector<Observer> observers;
Mutex mutex;

bool add (const Observer& observer, const Observer::Callback callback = nullptr) {
bool add (const Observer& observer, const typename Observer::Callback callback = nullptr) {
Lock lock(this->mutex);
if (this->has(observer)) {
auto& existing = this->get(observer.id);
Expand Down

0 comments on commit c28cd63

Please sign in to comment.